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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/tag-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
const cursorPosition = cursor.getBufferPosition();
const scope = cursor.getScopeDescriptor();
const rubyScopes = scope.getScopesArray().filter(s => /^source\.ruby($|\.)/.test(s));
const puppetScopes = scope.getScopesArray().filter(s => /^source\.puppet($|\.)/.test(s));

const wordRegExp = rubyScopes.length ?
(nonWordCharacters = atom.config.get('editor.nonWordCharacters', {scope}),
Expand Down Expand Up @@ -65,6 +66,14 @@ export default {
addSymbol(wordAtCursor(symbol, cursorWithinSymbol, ':', true));
// Additionally, also look up the bare word under cursor
addSymbol(wordAtCursor(symbol, cursorWithinSymbol, ':'));
} else if (puppetScopes.length && symbol.indexOf('::') > -1) {
const cursorWithinSymbol = cursorPosition.column - range.start.column;
// Add fully-qualified ruby constant up until the cursor position
addSymbol(wordAtCursor(symbol, cursorWithinSymbol, '::', true));
// Additionally, also look up the bare word under cursor
addSymbol(wordAtCursor(symbol, cursorWithinSymbol, '::'));


} else {
addSymbol(symbol);
}
Expand Down