Skip to content

Commit 6cd9921

Browse files
committed
Add string properties declaration to the completion list
1 parent 66d4010 commit 6cd9921

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
@@ -965,6 +965,9 @@ namespace ts.Completions {
965965
symbolToOriginInfoMap[getSymbolId(firstAccessibleSymbol)] =
966966
!moduleSymbol || !isExternalModuleSymbol(moduleSymbol) ? { kind: SymbolOriginInfoKind.SymbolMemberNoExport } : { kind: SymbolOriginInfoKind.SymbolMemberExport, moduleSymbol, isDefaultExport: false };
967967
}
968+
else if (preferences.includeCompletionsWithInsertText) {
969+
symbols.push(symbol);
970+
}
968971
}
969972
else {
970973
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)