This repository was archived by the owner on Sep 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module.exports =
1111 completions : COMPLETIONS
1212
1313 getSuggestions : (request ) ->
14- if @ isJavaScript (request)
14+ if @ isJavaScript (request) and @ isIgnoreInJavaScript (request)
1515 @ getJavascriptCompletions (request)
1616 else if @ isHtml (request)
1717 if @ isAttributeStart (request)
@@ -26,6 +26,17 @@ module.exports =
2626 return true if scope .startsWith (' source' ) and scope .endsWith (' .js' )
2727 return false
2828
29+ isIgnoreInJavaScript : ({ scopeDescriptor }) ->
30+ scopes = scopeDescriptor .getScopesArray ()
31+ return false if scopes .indexOf (' punctuation.terminator.statement.js' ) isnt - 1 or
32+ scopes .indexOf (' keyword.operator.assignment.js' ) isnt - 1 or
33+ scopes .indexOf (' meta.delimiter.object.comma.js' ) isnt - 1 or
34+ scopes .indexOf (' keyword.operator.comparison.js' ) isnt - 1 or
35+ scopes .indexOf (' keyword.operator.ternary.js' ) isnt - 1 or
36+ scopes .indexOf (' keyword.operator.js' ) isnt - 1 or
37+ scopes .indexOf (' string.quoted.template.js' ) isnt - 1
38+ return true
39+
2940 isHtml : ({ scopeDescriptor }) ->
3041 for scope in scopeDescriptor .getScopesArray ()
3142 return true if scope .endsWith (' .html' )
You can’t perform that action at this time.
0 commit comments