fix shouldTrigger check

This commit is contained in:
chemzqm 2019-07-09 15:37:16 +08:00
parent f574fc35bd
commit ea84909a86

View file

@ -310,11 +310,8 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
pre: string,
option: any
): boolean {
if (triggerCharacter === '.') {
if (pre.match(/[\s\.'"]\.$/)) {
return false
}
} else if (triggerCharacter === '@') {
if (triggerCharacter && this.client.apiVersion.lt(API.v290)) {
if (triggerCharacter === '@') {
// trigger in string
if (option.synname && /string/i.test(option.synname)) {
return true
@ -326,6 +323,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
} else if (triggerCharacter === '<') {
return false
}
}
return true
}