Add 'string' ScriptElementKind (#23821)

This commit is contained in:
Andy
2018-05-07 12:39:00 -07:00
committed by GitHub
parent 05b250691f
commit 2604bb4dd3
5 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ namespace ts.Completions {
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, entries };
}
case StringLiteralCompletionKind.Types: {
const entries = completion.types.map(type => ({ name: type.value, kindModifiers: ScriptElementKindModifier.none, kind: ScriptElementKind.typeElement, sortText: "0" }));
const entries = completion.types.map(type => ({ name: type.value, kindModifiers: ScriptElementKindModifier.none, kind: ScriptElementKind.string, sortText: "0" }));
return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, entries };
}
default:
+3
View File
@@ -995,6 +995,9 @@ namespace ts {
* <JsxTagName attribute1 attribute2={0} />
*/
jsxAttribute = "JSX attribute",
/** String literal */
string = "string",
}
export const enum ScriptElementKindModifier {
+3 -1
View File
@@ -5021,7 +5021,9 @@ declare namespace ts {
/**
* <JsxTagName attribute1 attribute2={0} />
*/
jsxAttribute = "JSX attribute"
jsxAttribute = "JSX attribute",
/** String literal */
string = "string"
}
enum ScriptElementKindModifier {
none = "",
+3 -1
View File
@@ -5021,7 +5021,9 @@ declare namespace ts {
/**
* <JsxTagName attribute1 attribute2={0} />
*/
jsxAttribute = "JSX attribute"
jsxAttribute = "JSX attribute",
/** String literal */
string = "string"
}
enum ScriptElementKindModifier {
none = "",
@@ -21,7 +21,7 @@ goTo.marker("path");
verify.completionListContains("other", "other", "", "script");
goTo.marker("type");
verify.completionListContains("a", "a", "", "type");
verify.completionListContains("a", "a", "", "string");
goTo.marker("prop");
verify.completionListContains("x", "(property) I.x: number", "Prop doc ", "property");