Skip to content

add puppet support #210

@droopy4096

Description

@droopy4096

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions