Skip to content

Commit 2604bb4

Browse files
author
Andy
authored
Add 'string' ScriptElementKind (microsoft#23821)
1 parent 05b2506 commit 2604bb4

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

src/services/completions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace ts.Completions {
8181
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, entries };
8282
}
8383
case StringLiteralCompletionKind.Types: {
84-
const entries = completion.types.map(type => ({ name: type.value, kindModifiers: ScriptElementKindModifier.none, kind: ScriptElementKind.typeElement, sortText: "0" }));
84+
const entries = completion.types.map(type => ({ name: type.value, kindModifiers: ScriptElementKindModifier.none, kind: ScriptElementKind.string, sortText: "0" }));
8585
return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, entries };
8686
}
8787
default:

src/services/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,9 @@ namespace ts {
995995
* <JsxTagName attribute1 attribute2={0} />
996996
*/
997997
jsxAttribute = "JSX attribute",
998+
999+
/** String literal */
1000+
string = "string",
9981001
}
9991002

10001003
export const enum ScriptElementKindModifier {

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5021,7 +5021,9 @@ declare namespace ts {
50215021
/**
50225022
* <JsxTagName attribute1 attribute2={0} />
50235023
*/
5024-
jsxAttribute = "JSX attribute"
5024+
jsxAttribute = "JSX attribute",
5025+
/** String literal */
5026+
string = "string"
50255027
}
50265028
enum ScriptElementKindModifier {
50275029
none = "",

tests/baselines/reference/api/typescript.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5021,7 +5021,9 @@ declare namespace ts {
50215021
/**
50225022
* <JsxTagName attribute1 attribute2={0} />
50235023
*/
5024-
jsxAttribute = "JSX attribute"
5024+
jsxAttribute = "JSX attribute",
5025+
/** String literal */
5026+
string = "string"
50255027
}
50265028
enum ScriptElementKindModifier {
50275029
none = "",

tests/cases/fourslash/completionForStringLiteral_details.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ goTo.marker("path");
2121
verify.completionListContains("other", "other", "", "script");
2222

2323
goTo.marker("type");
24-
verify.completionListContains("a", "a", "", "type");
24+
verify.completionListContains("a", "a", "", "string");
2525

2626
goTo.marker("prop");
2727
verify.completionListContains("x", "(property) I.x: number", "Prop doc ", "property");

0 commit comments

Comments
 (0)