Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 05dffe7

Browse files
committedJan 5, 2018
disable autocomplete with special characters
especially comman and so on close #83
1 parent 113101b commit 05dffe7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎lib/provider.coffee

+12-1
Original file line numberDiff line numberDiff 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')

0 commit comments

Comments
 (0)
This repository has been archived.