Merge pull request #31290 from a-tarasyuk/bug/29880

29880 - No completions for computed string properties
This commit is contained in:
Daniel Rosenwasser 2019-06-10 13:45:58 -07:00 committed by GitHub
commit 79aff027f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -1036,6 +1036,9 @@ namespace ts.Completions {
symbolToOriginInfoMap[getSymbolId(firstAccessibleSymbol)] =
!moduleSymbol || !isExternalModuleSymbol(moduleSymbol) ? { kind: SymbolOriginInfoKind.SymbolMemberNoExport } : { kind: SymbolOriginInfoKind.SymbolMemberExport, moduleSymbol, isDefaultExport: false };
}
else if (preferences.includeCompletionsWithInsertText) {
symbols.push(symbol);
}
}
else {
symbols.push(symbol);

View File

@ -0,0 +1,18 @@
/// <reference path="fourslash.ts" />
//// const p2 = "p2";
//// interface A {
//// ["p1"]: string;
//// [p2]: string;
//// }
//// declare const a: A;
//// a[|./**/|]
verify.completions({
marker: "",
exact: [
{ name: "p1" },
{ name: "p2", insertText: '[p2]', replacementSpan: test.ranges()[0] },
],
preferences: { includeInsertTextCompletions: true },
});