Check the correct previous text for suggestions

This commit is contained in:
Matt Bierner
2018-09-11 15:04:50 -07:00
parent 3fd4c7f4bd
commit 6ed4cced25

View File

@@ -459,7 +459,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
if (position.character > 1) {
const preText = document.getText(new vscode.Range(
position.line, 0,
position.line, position.character - 1));
position.line, position.character));
return preText.match(/(^|[a-z_$\(\)\[\]\{\}]|[^.]\.)\s*$/ig) !== null;
}