Skip to content

Commit 27b29cd

Browse files
committed
Revert "Cherry-pick PR microsoft#47096 into release-4.5 (microsoft#47105)"
This reverts commit 1d4ec40.
1 parent 0854a93 commit 27b29cd

File tree

2 files changed

+1
-79
lines changed

2 files changed

+1
-79
lines changed

src/services/completions.ts

+1-18
Original file line numberDiff line numberDiff line change
@@ -713,25 +713,8 @@ namespace ts.Completions {
713713
}
714714
}
715715

716-
// Before offering up a JSX attribute snippet, ensure that we aren't potentially completing
717-
// a tag name; this may appear as an attribute after the "<" when the tag has not yet been
718-
// closed, as in:
719-
//
720-
// return <>
721-
// foo <butto|
722-
// </>
723-
//
724-
// We can detect this case by checking if both:
725-
//
726-
// 1. The location is "<", so we are completing immediately after it.
727-
// 2. The "<" has the same position as its parent, so is not a binary expression.
728716
const kind = SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
729-
if (
730-
kind === ScriptElementKind.jsxAttribute
731-
&& (location.kind !== SyntaxKind.LessThanToken || location.pos !== location.parent.pos)
732-
&& preferences.includeCompletionsWithSnippetText
733-
&& preferences.jsxAttributeCompletionStyle
734-
&& preferences.jsxAttributeCompletionStyle !== "none") {
717+
if (kind === ScriptElementKind.jsxAttribute && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
735718
let useBraces = preferences.jsxAttributeCompletionStyle === "braces";
736719
const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
737720

tests/cases/fourslash/jsxAttributeAsTagNameNoSnippet.ts

-61
This file was deleted.

0 commit comments

Comments
 (0)