Support whitespace after dot for bracket completions

Fixes #64002
This commit is contained in:
Matt Bierner
2018-11-29 10:44:12 -08:00
parent 1feed6a23c
commit 3f33ef2593

View File

@@ -68,7 +68,8 @@ class MyCompletionItem extends vscode.CompletionItem {
if (tsEntry.replacementSpan) { if (tsEntry.replacementSpan) {
this.range = typeConverters.Range.fromTextSpan(tsEntry.replacementSpan); this.range = typeConverters.Range.fromTextSpan(tsEntry.replacementSpan);
if (this.insertText[0] === '[') { // o.x -> o['x'] if (this.insertText[0] === '[') { // o.x -> o['x']
this.filterText = '.' + this.label; const textBeingReplaced = document.getText(this.range);
this.filterText = textBeingReplaced + this.label;
} }
// Make sure we only replace a single line at most // Make sure we only replace a single line at most