Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add puppet support #210

Open
droopy4096 opened this issue Mar 13, 2019 · 0 comments
Open

add puppet support #210

droopy4096 opened this issue Mar 13, 2019 · 0 comments

Comments

@droopy4096
Copy link

droopy4096 commented Mar 13, 2019

currently puppet support is "broken" for tokens with ':' in their names.

I can't currently fork the project to submit PR as I've submitted similar fix to upstream project and github won't allow two forks of the same originating project :(

fix is in file-view.cofee:67-77 :

    cursor = editor.getLastCursor()
    if cursor.getScopeDescriptor().getScopesArray().indexOf('source.ruby') isnt -1
      # Include ! and ? in word regular expression for ruby files
      range = cursor.getCurrentWordBufferRange(wordRegex: /[\w!?]*/g)
    else if cursor.getScopeDescriptor().getScopesArray().indexOf('source.clojure') isnt -1
      range = cursor.getCurrentWordBufferRange(wordRegex: /[\w\*\+!\-_'\?<>]([\w\*\+!\-_'\?<>\.:]+[\w\*\+!\-_'\?<>]?)?/g)
    if cursor.getScopeDescriptor().getScopesArray().indexOf('source.puppet') isnt -1
      range = cursor.getCurrentWordBufferRange(wordRegex: /[\w!?:]*/g)
    else
      range = cursor.getCurrentWordBufferRange()
    return editor.getTextInRange(range)

note the inclusion of the source.puppet block. Pretty crude but tested to work.

sample data: https://gist.github.com/droopy4096/cf5ed9254d9ac76cdee4f395528ad06c

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

No branches or pull requests

1 participant