From 9c1e35ee7ee3eb226aa8833ab76ec561f840b282 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 12 Jan 2022 13:15:15 -0800 Subject: [PATCH] Deprecate ScriptElementKind.jsxAttribute --- src/services/symbolDisplay.ts | 14 ++---------- src/services/types.ts | 1 + .../reference/api/tsserverlibrary.d.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 + tests/cases/fourslash/completionsInJsxTag.ts | 8 +++---- .../fourslash/completionsJsxAttribute.ts | 4 ++-- .../completionsJsxAttributeGeneric.ts | 2 +- .../completionsJsxAttributeInitializer.ts | 4 ++-- .../jsxAttributeSnippetCompletionClosed.ts | 22 +++++++++---------- .../jsxAttributeSnippetCompletionUnclosed.ts | 18 +++++++-------- tests/cases/fourslash/jsxGenericQuickInfo.tsx | 4 ++-- .../fourslash/jsxTagNameCompletionClosed.ts | 4 ++-- .../fourslash/jsxTagNameCompletionUnclosed.ts | 4 ++-- .../jsxTagNameCompletionUnderElementClosed.ts | 6 ++--- ...sxTagNameCompletionUnderElementUnclosed.ts | 6 ++--- tests/cases/fourslash/tsxCompletion12.ts | 4 ++-- tests/cases/fourslash/tsxCompletion13.ts | 10 ++++----- tests/cases/fourslash/tsxCompletion7.ts | 4 ++-- tests/cases/fourslash/tsxQuickInfo3.ts | 4 ++-- tests/cases/fourslash/tsxQuickInfo4.ts | 4 ++-- tests/cases/fourslash/tsxQuickInfo5.ts | 4 ++-- 21 files changed, 61 insertions(+), 68 deletions(-) diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index f1447b30cd9b5..c7ee58ff28e63 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -83,18 +83,8 @@ namespace ts.SymbolDisplay { } return unionPropertyKind; } - // If we requested completions after `x.` at the top-level, we may be at a source file location. - switch (location.parent && location.parent.kind) { - // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case SyntaxKind.JsxOpeningElement: - case SyntaxKind.JsxElement: - case SyntaxKind.JsxSelfClosingElement: - return location.kind === SyntaxKind.Identifier ? ScriptElementKind.memberVariableElement : ScriptElementKind.jsxAttribute; - case SyntaxKind.JsxAttribute: - return ScriptElementKind.jsxAttribute; - default: - return ScriptElementKind.memberVariableElement; - } + + return ScriptElementKind.memberVariableElement; } return ScriptElementKind.unknown; diff --git a/src/services/types.ts b/src/services/types.ts index bc5e0d86d87fa..eed10d786c9f2 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -1457,6 +1457,7 @@ namespace ts { /** * + * @deprecated */ jsxAttribute = "JSX attribute", diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f822907cd1430..b07335dd0f491 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -6594,6 +6594,7 @@ declare namespace ts { externalModuleName = "external module name", /** * + * @deprecated */ jsxAttribute = "JSX attribute", /** String literal */ diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 0137fbeb78a75..fab7e4ba591f5 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -6594,6 +6594,7 @@ declare namespace ts { externalModuleName = "external module name", /** * + * @deprecated */ jsxAttribute = "JSX attribute", /** String literal */ diff --git a/tests/cases/fourslash/completionsInJsxTag.ts b/tests/cases/fourslash/completionsInJsxTag.ts index 4f5862e820885..8fd2fcfe4cf5a 100644 --- a/tests/cases/fourslash/completionsInJsxTag.ts +++ b/tests/cases/fourslash/completionsInJsxTag.ts @@ -26,16 +26,16 @@ verify.completions({ exact: [ { name: "aria-label", - text: "(JSX attribute) \"aria-label\": string", + text: "(property) \"aria-label\": string", documentation: "Label docs", - kind: "JSX attribute", + kind: "property", kindModifiers: "declare", }, { name: "foo", - text: "(JSX attribute) foo: string", + text: "(property) foo: string", documentation: "Doc", - kind: "JSX attribute", + kind: "property", kindModifiers: "declare", }, ], diff --git a/tests/cases/fourslash/completionsJsxAttribute.ts b/tests/cases/fourslash/completionsJsxAttribute.ts index 592c2c8ed3c72..3dcf49d487108 100644 --- a/tests/cases/fourslash/completionsJsxAttribute.ts +++ b/tests/cases/fourslash/completionsJsxAttribute.ts @@ -17,8 +17,8 @@ ////
; const exact: ReadonlyArray = [ - { name: "bar", kind: "JSX attribute", kindModifiers: "declare", text: "(JSX attribute) bar: string" }, - { name: "foo", kind: "JSX attribute", kindModifiers: "declare", text: "(JSX attribute) foo: boolean", documentation: "Doc" }, + { name: "bar", kind: "property", kindModifiers: "declare", text: "(property) bar: string" }, + { name: "foo", kind: "property", kindModifiers: "declare", text: "(property) foo: boolean", documentation: "Doc" }, ]; verify.completions({ marker: "", exact }); edit.insert("f"); diff --git a/tests/cases/fourslash/completionsJsxAttributeGeneric.ts b/tests/cases/fourslash/completionsJsxAttributeGeneric.ts index 9180c691f09f4..2e50a8a895e8c 100644 --- a/tests/cases/fourslash/completionsJsxAttributeGeneric.ts +++ b/tests/cases/fourslash/completionsJsxAttributeGeneric.ts @@ -11,7 +11,7 @@ marker, exact: [{ name: 'name', - kind: 'JSX attribute', + kind: 'property', kindModifiers: 'declare' }] }) diff --git a/tests/cases/fourslash/completionsJsxAttributeInitializer.ts b/tests/cases/fourslash/completionsJsxAttributeInitializer.ts index 2076c6588f4d7..f383d52375912 100644 --- a/tests/cases/fourslash/completionsJsxAttributeInitializer.ts +++ b/tests/cases/fourslash/completionsJsxAttributeInitializer.ts @@ -9,8 +9,8 @@ verify.completions({ marker: "", includes: [ { name: "x", text: "(parameter) x: number", kind: "parameter", insertText: "{x}" }, - { name: "p", text: "(JSX attribute) p: number", kind: "JSX attribute", insertText: "{this.p}", sortText: completion.SortText.SuggestedClassMembers, source: completion.CompletionSource.ThisProperty }, - { name: "a b", text: '(JSX attribute) "a b": number', kind: "JSX attribute", insertText: '{this["a b"]}', sortText: completion.SortText.SuggestedClassMembers, source: completion.CompletionSource.ThisProperty }, + { name: "p", text: "(property) p: number", kind: "property", insertText: "{this.p}", sortText: completion.SortText.SuggestedClassMembers, source: completion.CompletionSource.ThisProperty }, + { name: "a b", text: '(property) "a b": number', kind: "property", insertText: '{this["a b"]}', sortText: completion.SortText.SuggestedClassMembers, source: completion.CompletionSource.ThisProperty }, ], preferences: { includeInsertTextCompletions: true, diff --git a/tests/cases/fourslash/jsxAttributeSnippetCompletionClosed.ts b/tests/cases/fourslash/jsxAttributeSnippetCompletionClosed.ts index ddb12244867c5..993561b53f537 100644 --- a/tests/cases/fourslash/jsxAttributeSnippetCompletionClosed.ts +++ b/tests/cases/fourslash/jsxAttributeSnippetCompletionClosed.ts @@ -60,15 +60,15 @@ var preferences: FourSlashInterface.UserPreferences = { }; verify.completions( - { marker: "1", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "2", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "3", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "4", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "5", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "6", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "7", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "8", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "9", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "10", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "11", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "1", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "2", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "3", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "4", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "5", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "6", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "7", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "8", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "9", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "10", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "11", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, ) diff --git a/tests/cases/fourslash/jsxAttributeSnippetCompletionUnclosed.ts b/tests/cases/fourslash/jsxAttributeSnippetCompletionUnclosed.ts index 7099e13c2057f..5816f56500d10 100644 --- a/tests/cases/fourslash/jsxAttributeSnippetCompletionUnclosed.ts +++ b/tests/cases/fourslash/jsxAttributeSnippetCompletionUnclosed.ts @@ -60,15 +60,15 @@ var preferences: FourSlashInterface.UserPreferences = { }; verify.completions( - { marker: "1", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "2", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "3", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "4", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "5", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "6", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "1", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "2", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "3", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "4", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "5", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "6", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, { marker: "7", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "8", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "9", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "8", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "9", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, { marker: "10", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, - { marker: "11", preferences, includes: { name: "className", insertText: "className={$1}", text: "(JSX attribute) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, + { marker: "11", preferences, includes: { name: "className", insertText: "className={$1}", text: "(property) className?: string", isSnippet: true, sortText: completion.SortText.OptionalMember } }, ) diff --git a/tests/cases/fourslash/jsxGenericQuickInfo.tsx b/tests/cases/fourslash/jsxGenericQuickInfo.tsx index 7566193737651..9e1ff3b84b083 100644 --- a/tests/cases/fourslash/jsxGenericQuickInfo.tsx +++ b/tests/cases/fourslash/jsxGenericQuickInfo.tsx @@ -29,6 +29,6 @@ verify.quickInfoAt("0", "(property) PropsA.renderItem: (item: number) => string"); verify.quickInfoAt("1", "(parameter) item: number"); verify.quickInfoAt("2", `(property) PropsA.name: "A"`, 'comments for A'); -verify.quickInfoAt("3", "(JSX attribute) PropsA.renderItem: (item: number) => string"); +verify.quickInfoAt("3", "(property) PropsA.renderItem: (item: number) => string"); verify.quickInfoAt("4", "(parameter) item: number"); -verify.quickInfoAt("5", `(JSX attribute) PropsA.name: "A"`, 'comments for A'); +verify.quickInfoAt("5", `(property) PropsA.name: "A"`, 'comments for A'); diff --git a/tests/cases/fourslash/jsxTagNameCompletionClosed.ts b/tests/cases/fourslash/jsxTagNameCompletionClosed.ts index db53a6d0b782e..144c53ba60654 100644 --- a/tests/cases/fourslash/jsxTagNameCompletionClosed.ts +++ b/tests/cases/fourslash/jsxTagNameCompletionClosed.ts @@ -47,8 +47,8 @@ var preferences: FourSlashInterface.UserPreferences = { verify.completions( { marker: "1", preferences, includes: { name: "Foo", text: "const Foo: NestedInterface" } }, { marker: "2", preferences, includes: { name: "Foo", text: "const Foo: NestedInterface" } }, - { marker: "3", preferences, includes: { name: "Foo", text: "(JSX attribute) NestedInterface.Foo: NestedInterface" } }, + { marker: "3", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, { marker: "4", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, - { marker: "5", preferences, includes: { name: "Foo", text: "(JSX attribute) NestedInterface.Foo: NestedInterface" } }, + { marker: "5", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, { marker: "6", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, ) diff --git a/tests/cases/fourslash/jsxTagNameCompletionUnclosed.ts b/tests/cases/fourslash/jsxTagNameCompletionUnclosed.ts index fe62c44247a1e..515c631c75ec0 100644 --- a/tests/cases/fourslash/jsxTagNameCompletionUnclosed.ts +++ b/tests/cases/fourslash/jsxTagNameCompletionUnclosed.ts @@ -47,8 +47,8 @@ var preferences: FourSlashInterface.UserPreferences = { verify.completions( { marker: "1", preferences, includes: { name: "Foo", text: "const Foo: NestedInterface" } }, { marker: "2", preferences, includes: { name: "Foo", text: "const Foo: NestedInterface" } }, - { marker: "3", preferences, includes: { name: "Foo", text: "(JSX attribute) NestedInterface.Foo: NestedInterface" } }, + { marker: "3", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, { marker: "4", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, - { marker: "5", preferences, includes: { name: "Foo", text: "(JSX attribute) NestedInterface.Foo: NestedInterface" } }, + { marker: "5", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, { marker: "6", preferences, includes: { name: "Foo", text: "(property) NestedInterface.Foo: NestedInterface" } }, ) diff --git a/tests/cases/fourslash/jsxTagNameCompletionUnderElementClosed.ts b/tests/cases/fourslash/jsxTagNameCompletionUnderElementClosed.ts index 0ebb48011fc62..9d7e522ad1606 100644 --- a/tests/cases/fourslash/jsxTagNameCompletionUnderElementClosed.ts +++ b/tests/cases/fourslash/jsxTagNameCompletionUnderElementClosed.ts @@ -29,7 +29,7 @@ var preferences: FourSlashInterface.UserPreferences = { }; verify.completions( - { marker: "1", preferences, includes: { name: "button", text: "(JSX attribute) JSX.IntrinsicElements.button: any" } }, - { marker: "2", preferences, includes: { name: "button", text: "(JSX attribute) JSX.IntrinsicElements.button: any" } }, - { marker: "3", preferences, includes: { name: "button", text: "(JSX attribute) JSX.IntrinsicElements.button: any" } }, + { marker: "1", preferences, includes: { name: "button", text: "(property) JSX.IntrinsicElements.button: any" } }, + { marker: "2", preferences, includes: { name: "button", text: "(property) JSX.IntrinsicElements.button: any" } }, + { marker: "3", preferences, includes: { name: "button", text: "(property) JSX.IntrinsicElements.button: any" } }, ) diff --git a/tests/cases/fourslash/jsxTagNameCompletionUnderElementUnclosed.ts b/tests/cases/fourslash/jsxTagNameCompletionUnderElementUnclosed.ts index e037477a7ab82..db243b1102558 100644 --- a/tests/cases/fourslash/jsxTagNameCompletionUnderElementUnclosed.ts +++ b/tests/cases/fourslash/jsxTagNameCompletionUnderElementUnclosed.ts @@ -29,7 +29,7 @@ var preferences: FourSlashInterface.UserPreferences = { }; verify.completions( - { marker: "1", preferences, includes: { name: "button", text: "(JSX attribute) JSX.IntrinsicElements.button: any" } }, - { marker: "2", preferences, includes: { name: "button", text: "(JSX attribute) JSX.IntrinsicElements.button: any" } }, - { marker: "3", preferences, includes: { name: "button", text: "(JSX attribute) JSX.IntrinsicElements.button: any" } }, + { marker: "1", preferences, includes: { name: "button", text: "(property) JSX.IntrinsicElements.button: any" } }, + { marker: "2", preferences, includes: { name: "button", text: "(property) JSX.IntrinsicElements.button: any" } }, + { marker: "3", preferences, includes: { name: "button", text: "(property) JSX.IntrinsicElements.button: any" } }, ) diff --git a/tests/cases/fourslash/tsxCompletion12.ts b/tests/cases/fourslash/tsxCompletion12.ts index 4b0b01c2241d0..c4feb1ae51ae7 100644 --- a/tests/cases/fourslash/tsxCompletion12.ts +++ b/tests/cases/fourslash/tsxCompletion12.ts @@ -28,14 +28,14 @@ verify.completions( exact: [ "propString", "propx", - { name: "optional", kind: "JSX attribute", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, + { name: "optional", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, ] }, { marker: "3", exact: [ "propString", - { name: "optional", kind: "JSX attribute", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, + { name: "optional", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, ] }, { marker: "4", exact: "propString" }, diff --git a/tests/cases/fourslash/tsxCompletion13.ts b/tests/cases/fourslash/tsxCompletion13.ts index b3dc913783a40..5b8a8d7e18b41 100644 --- a/tests/cases/fourslash/tsxCompletion13.ts +++ b/tests/cases/fourslash/tsxCompletion13.ts @@ -36,8 +36,8 @@ verify.completions( exact: [ "goTo", "onClick", - { name: "children", kind: "JSX attribute", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, - { name: "className", kind: "JSX attribute", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, + { name: "children", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, + { name: "className", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, ] }, { @@ -45,14 +45,14 @@ verify.completions( exact: [ "goTo", "onClick", - { name: "className", kind: "JSX attribute", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, + { name: "className", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, ] }, { marker: ["3", "4", "5"], exact: [ - { name: "children", kind: "JSX attribute", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, - { name: "className", kind: "JSX attribute", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, + { name: "children", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, + { name: "className", kind: "property", kindModifiers: "optional", sortText: completion.SortText.OptionalMember }, ] }, ); diff --git a/tests/cases/fourslash/tsxCompletion7.ts b/tests/cases/fourslash/tsxCompletion7.ts index 90a98c4f5a0d0..1d31441ca1b94 100644 --- a/tests/cases/fourslash/tsxCompletion7.ts +++ b/tests/cases/fourslash/tsxCompletion7.ts @@ -13,7 +13,7 @@ verify.completions({ marker: "", exact: [ - { name: "TWO", kind: "JSX attribute", kindModifiers: "declare", sortText: completion.SortText.LocationPriority }, - { name: "ONE", kind: "JSX attribute", kindModifiers: "declare", sortText: completion.SortText.MemberDeclaredBySpreadAssignment }, + { name: "TWO", kind: "property", kindModifiers: "declare", sortText: completion.SortText.LocationPriority }, + { name: "ONE", kind: "property", kindModifiers: "declare", sortText: completion.SortText.MemberDeclaredBySpreadAssignment }, ] }); diff --git a/tests/cases/fourslash/tsxQuickInfo3.ts b/tests/cases/fourslash/tsxQuickInfo3.ts index 614ffa878ef09..068fcab19f51f 100644 --- a/tests/cases/fourslash/tsxQuickInfo3.ts +++ b/tests/cases/fourslash/tsxQuickInfo3.ts @@ -24,7 +24,7 @@ verify.quickInfos({ 1: "class Opt", - 2: "(JSX attribute) propx: number", + 2: "(property) propx: number", 3: "const obj1: OptionProp", - 4: "(JSX attribute) propx: true" + 4: "(property) propx: true" }); diff --git a/tests/cases/fourslash/tsxQuickInfo4.ts b/tests/cases/fourslash/tsxQuickInfo4.ts index 7e1f8e2bc7ba0..f66d4dc4afd9a 100644 --- a/tests/cases/fourslash/tsxQuickInfo4.ts +++ b/tests/cases/fourslash/tsxQuickInfo4.ts @@ -48,8 +48,8 @@ verify.quickInfos({ 1: "function MainButton(linkProps: LinkProps): JSX.Element (+1 overload)", - 2: "(JSX attribute) LinkProps.to: string", + 2: "(property) LinkProps.to: string", 3: "function MainButton(buttonProps: ButtonProps): JSX.Element (+1 overload)", 4: "(method) ButtonProps.onClick(event?: React.MouseEvent): void", - 5: "(JSX attribute) extra-prop: true" + 5: "(property) extra-prop: true" }); diff --git a/tests/cases/fourslash/tsxQuickInfo5.ts b/tests/cases/fourslash/tsxQuickInfo5.ts index 3ebf1bd0bdd04..35f821fe6b28d 100644 --- a/tests/cases/fourslash/tsxQuickInfo5.ts +++ b/tests/cases/fourslash/tsxQuickInfo5.ts @@ -13,6 +13,6 @@ verify.quickInfos({ 1: "function ComponentWithTwoAttributes(l: {\n key1: T;\n value: U;\n}): JSX.Element", - 2: "(JSX attribute) key1: T", - 3: "(JSX attribute) value: U", + 2: "(property) key1: T", + 3: "(property) value: U", });