mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 00:36:29 -05:00
Add missing JSXSpreadAttribute case to JSX completion logic (#44514)
This commit is contained in:
@@ -1245,6 +1245,7 @@ namespace ts.Completions {
|
||||
break;
|
||||
|
||||
case SyntaxKind.JsxExpression:
|
||||
case SyntaxKind.JsxSpreadAttribute:
|
||||
// For `<div foo={true} [||] ></div>`, `parent` will be `{true}` and `previousToken` will be `}`
|
||||
if (previousToken.kind === SyntaxKind.CloseBraceToken && currentToken.kind === SyntaxKind.GreaterThanToken) {
|
||||
isJsxIdentifierExpected = true;
|
||||
|
||||
21
tests/cases/fourslash/jsxAriaLikeCompletions.ts
Normal file
21
tests/cases/fourslash/jsxAriaLikeCompletions.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
//@Filename: file.tsx
|
||||
////declare var React: any;
|
||||
////declare module JSX {
|
||||
//// interface Element { }
|
||||
//// interface IntrinsicElements {
|
||||
//// div: { "aria-whatever"?: string }
|
||||
//// }
|
||||
//// interface ElementAttributesProperty { props: any }
|
||||
////}
|
||||
////const a = <div {...{}} /*1*/></div>;
|
||||
|
||||
|
||||
verify.completions(
|
||||
{
|
||||
marker: "1",
|
||||
exact: [
|
||||
{name: "aria-whatever", sortText: completion.SortText.OptionalMember}
|
||||
]
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user