Skip to content

Commit 79aff02

Browse files
Merge pull request #31290 from a-tarasyuk/bug/29880
29880 - No completions for computed string properties
2 parents 8705844 + 8dba4d6 commit 79aff02

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/services/completions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,9 @@ namespace ts.Completions {
10361036
symbolToOriginInfoMap[getSymbolId(firstAccessibleSymbol)] =
10371037
!moduleSymbol || !isExternalModuleSymbol(moduleSymbol) ? { kind: SymbolOriginInfoKind.SymbolMemberNoExport } : { kind: SymbolOriginInfoKind.SymbolMemberExport, moduleSymbol, isDefaultExport: false };
10381038
}
1039+
else if (preferences.includeCompletionsWithInsertText) {
1040+
symbols.push(symbol);
1041+
}
10391042
}
10401043
else {
10411044
symbols.push(symbol);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
//// const p2 = "p2";
4+
//// interface A {
5+
//// ["p1"]: string;
6+
//// [p2]: string;
7+
//// }
8+
//// declare const a: A;
9+
//// a[|./**/|]
10+
11+
verify.completions({
12+
marker: "",
13+
exact: [
14+
{ name: "p1" },
15+
{ name: "p2", insertText: '[p2]', replacementSpan: test.ranges()[0] },
16+
],
17+
preferences: { includeInsertTextCompletions: true },
18+
});

0 commit comments

Comments
 (0)