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

Add puppet syntax support #245

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

droopy4096
Copy link

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

currently symbols-view has a special case for ruby notation (':'-separated) however it fails with Puppet notation ('::') - ruby's solution has been extended to provide puppet support

Alternate Designs

Alternatively there should be a map of language and word separators that could be extended by user. but implementation of such feature is beyond my current abilities in JS

Benefits

Puppet ctags will work as expected

Possible Drawbacks

none

Applicable Issues

#244

currently puppet ctags generated via: 

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


now if one highlights symbol: 'user::foo` the best this module would do is pick up 'user' module and not the 'user::foo' module. This fix is supposed to fix that. not tested
@rsese
Copy link

rsese commented Mar 7, 2019

Thanks for the contribution @droopy4096! Can you checkout my question in the issue you opened /cc #244 (comment)?

Also, as mentioned in the Requirements section above, the team will need tests to be added before they can review and tests will help guard against future changes breaking your work 😄

@droopy4096
Copy link
Author

sorry I'm temporarily away from my puppet environment... I'll post an update soon

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

Successfully merging this pull request may close these issues.

2 participants