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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 4 deletions

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:

View File

@ -995,6 +995,9 @@ namespace ts {
* <JsxTagName attribute1 attribute2={0} />
*/
jsxAttribute = "JSX attribute",
/** String literal */
string = "string",
}
export const enum ScriptElementKindModifier {

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 = "",

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 = "",

View File

@ -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");