From 8717a7bcf1837ac489d792fca831334f524e8b7f Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 5 Apr 2018 09:17:34 -0700 Subject: [PATCH] Fix bug: `
` is not a jsx initializer (#23138) (#23167) * Fix bug: `
` is not a jsx initializer (#23138) * Don't use test feature only available in master branch --- src/services/completions.ts | 3 ++- .../completionsJsxAttributeInitializer2.ts | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index 209d04f763e..8392a884cfb 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -925,7 +925,8 @@ namespace ts.Completions { isJsxInitializer = true; break; case SyntaxKind.Identifier: - if (previousToken !== (parent as JsxAttribute).name) { + // For `
// @Filename: /a.tsx +////declare namespace JSX { +//// interface IntrinsicElements { +//// div: { a: string, b: string } +//// } +////} ////const foo = 0; -////
; +////
; +//// +////
+////
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"]);