Skip to content

Commit 01a7a3e

Browse files
authored
fix(53289): TypeScript cannot auto-complete keyword typeof (#53325)
1 parent c5b539d commit 01a7a3e

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/harness/fourslashInterfaceImpl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,7 @@ export namespace Completion {
11001100
"string",
11011101
"symbol",
11021102
"true",
1103+
"typeof",
11031104
"undefined",
11041105
"unique",
11051106
"unknown",

src/services/utilities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,7 @@ export const typeKeywords: readonly SyntaxKind[] = [
23182318
SyntaxKind.ReadonlyKeyword,
23192319
SyntaxKind.StringKeyword,
23202320
SyntaxKind.SymbolKeyword,
2321+
SyntaxKind.TypeOfKeyword,
23212322
SyntaxKind.TrueKeyword,
23222323
SyntaxKind.VoidKeyword,
23232324
SyntaxKind.UndefinedKeyword,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////export type A = typ/**/
4+
5+
verify.completions({
6+
marker: "",
7+
includes: [{ name: "typeof", sortText: completion.SortText.GlobalsOrKeywords }]
8+
});

0 commit comments

Comments
 (0)