Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Make goto definition understand classes like class::subbclass1::subclass2 #20

Open
cleonte opened this issue Oct 2, 2015 · 1 comment

Comments

@cleonte
Copy link

cleonte commented Oct 2, 2015

Hi All,

its there any way to make language-puppet understand classes like

class:subbclass1::subclass2 and goto defintion to work?

for vim-cgats i found something like this on the interent

--langdef=puppet
--langmap=puppet:.pp
--regex-puppet=/^class[ \t ]([:a-zA-Z0-9-]+)[ \t ]/\1/c,class/
--regex-puppet=/^site[ \t ]
([a-zA-Z0-9_-]+)[ \t ]/\1/s,site/
--regex-puppet=/^node[ \t ]
([a-zA-Z0-9_-]+)[ \t ]/\1/n,node/
--regex-puppet=/^define[ \t ]
([:a-zA-Z0-9_-]+)[ \t ]/\1/d,definition/
--regex-puppet=/^ ([a-zA-Zi:]+) *{ *(.
) *:/\1[\2]/r,resource/
--regex-puppet=/^ *([A-Z][a-zA-Z0-9_:]+) *{/\1/f,default/

@ghost
Copy link

ghost commented Mar 29, 2016

Hi @cleonte, I had the same issue and found out that you must change the 'non-word characters' config of language-puppet (and perhaps default IDE settings).

non-word characters: /\()"',.;<>~!@#$%^&*|+=[]{}`?-

The trick is to remove : as a delimiter ; which then have the IDE search ctags using full string.

I'm using package atom-ctags with default options and it works ok.

There is a snippet of my config.cson

"*":
  "atom-ctags":
    GotoSymbolKey: [
      "ctrl"
    ]
    autoBuildTagsWhenActive: true
  core:
    disabledPackages: [
      "symbols-view"
    ]
  editor:
    nonWordCharacters: "/\\()\"',.;<>~!@#$%^&*|+=[]{}`?-"
".puppet.source":
  editor:
    nonWordCharacters: "/\\()\"',.;<>~!@#$%^&*|+=[]{}`?-"

Might it be good to set this as default for language puppet?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant