diff --git a/dist/hyperclickProvider.js b/dist/hyperclickProvider.js index 2bf7f081c..8cc4b58e2 100644 --- a/dist/hyperclickProvider.js +++ b/dist/hyperclickProvider.js @@ -6,12 +6,12 @@ var TS_GRAMMARS = immutable_1.Set(["source.ts", "source.tsx"]); exports.providerName = "typescript-hyperclick-provider"; exports.wordRegExp = /([A-Za-z0-9_])+|['"`](\\.|[^'"`\\\\])*['"`]/g; function getSuggestionForWord(textEditor, text, range) { + if (!TS_GRAMMARS.has(textEditor.getGrammar().scopeName)) { + return null; + } return { range: range, callback: function () { - if (!TS_GRAMMARS.has(textEditor.getGrammar().scopeName)) { - return null; - } var filePathPosition = { filePath: textEditor.getPath(), position: atomUtils.getEditorPositionForBufferPosition(textEditor, range.start) diff --git a/lib/hyperclickProvider.ts b/lib/hyperclickProvider.ts index f040775cb..d47220e43 100644 --- a/lib/hyperclickProvider.ts +++ b/lib/hyperclickProvider.ts @@ -9,13 +9,13 @@ export let providerName = "typescript-hyperclick-provider"; export let wordRegExp = /([A-Za-z0-9_])+|['"`](\\.|[^'"`\\\\])*['"`]/g; export function getSuggestionForWord(textEditor: AtomCore.IEditor, text: string, range: TextBuffer.IRange) { + if (!TS_GRAMMARS.has(textEditor.getGrammar().scopeName)) { + return null; + } + return { range: range, callback() { - if (!TS_GRAMMARS.has(textEditor.getGrammar().scopeName)) { - return null; - } - let filePathPosition = { filePath: textEditor.getPath(), position: atomUtils.getEditorPositionForBufferPosition(textEditor, range.start)