@@ -100,7 +100,7 @@ var ts;
100100 // The following is baselined as a literal template type without intervention
101101 /** The version of the TypeScript compiler release */
102102 // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103- ts.version = "4.5.3 ";
103+ ts.version = "4.5.4 ";
104104 /* @internal */
105105 var Comparison;
106106 (function (Comparison) {
@@ -128608,8 +128608,24 @@ var ts;
128608128608 source = CompletionSource.ClassMemberSnippet;
128609128609 }
128610128610 }
128611+ // Before offering up a JSX attribute snippet, ensure that we aren't potentially completing
128612+ // a tag name; this may appear as an attribute after the "<" when the tag has not yet been
128613+ // closed, as in:
128614+ //
128615+ // return <>
128616+ // foo <butto|
128617+ // </>
128618+ //
128619+ // We can detect this case by checking if both:
128620+ //
128621+ // 1. The location is "<", so we are completing immediately after it.
128622+ // 2. The "<" has the same position as its parent, so is not a binary expression.
128611128623 var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
128612- if (kind === "JSX attribute" /* jsxAttribute */ && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
128624+ if (kind === "JSX attribute" /* jsxAttribute */
128625+ && (location.kind !== 29 /* LessThanToken */ || location.pos !== location.parent.pos)
128626+ && preferences.includeCompletionsWithSnippetText
128627+ && preferences.jsxAttributeCompletionStyle
128628+ && preferences.jsxAttributeCompletionStyle !== "none") {
128613128629 var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces";
128614128630 var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
128615128631 // If is boolean like or undefined, don't return a snippet we want just to return the completion.
0 commit comments