mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
* Fix bug: `<div a="1" b/**/ >` is not a jsx initializer (#23138) * Don't use test feature only available in master branch
This commit is contained in:
parent
4d783d0bff
commit
8717a7bcf1
@ -925,7 +925,8 @@ namespace ts.Completions {
|
||||
isJsxInitializer = true;
|
||||
break;
|
||||
case SyntaxKind.Identifier:
|
||||
if (previousToken !== (parent as JsxAttribute).name) {
|
||||
// For `<div x=[|f/**/|]`, `parent` will be `x` and `previousToken.parent` will be `f` (which is its own JsxAttribute)
|
||||
if (parent !== previousToken.parent && !(parent as JsxAttribute).initializer) {
|
||||
isJsxInitializer = previousToken as Identifier;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,24 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /a.tsx
|
||||
////declare namespace JSX {
|
||||
//// interface IntrinsicElements {
|
||||
//// div: { a: string, b: string }
|
||||
//// }
|
||||
////}
|
||||
////const foo = 0;
|
||||
////<div x=[|f/**/|] />;
|
||||
////<div x=[|f/*0*/|] />;
|
||||
////
|
||||
////<div a="1" b/*1*/ />
|
||||
////<div a /*2*/ />
|
||||
|
||||
const [replacementSpan] = test.ranges();
|
||||
goTo.marker();
|
||||
goTo.marker("0");
|
||||
verify.completionListContains("foo", "const foo: 0", undefined, "const", undefined, undefined, {
|
||||
includeInsertTextCompletions: true,
|
||||
insertText: "{foo}",
|
||||
replacementSpan,
|
||||
});
|
||||
|
||||
verify.completionsAt("1", ["b"]);
|
||||
verify.completionsAt("2", ["b"]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user