Skip to content

Commit

Permalink
Revert "Cherry-pick PR microsoft#47096 into release-4.5 (microsoft#47105
Browse files Browse the repository at this point in the history
)"

This reverts commit 1d4ec40.
  • Loading branch information
jakebailey committed Jan 12, 2022
1 parent 0854a93 commit 27b29cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 79 deletions.
19 changes: 1 addition & 18 deletions src/services/completions.ts
Expand Up @@ -713,25 +713,8 @@ namespace ts.Completions {
}
}

// Before offering up a JSX attribute snippet, ensure that we aren't potentially completing
// a tag name; this may appear as an attribute after the "<" when the tag has not yet been
// closed, as in:
//
// return <>
// foo <butto|
// </>
//
// We can detect this case by checking if both:
//
// 1. The location is "<", so we are completing immediately after it.
// 2. The "<" has the same position as its parent, so is not a binary expression.
const kind = SymbolDisplay.getSymbolKind(typeChecker, symbol, location);
if (
kind === ScriptElementKind.jsxAttribute
&& (location.kind !== SyntaxKind.LessThanToken || location.pos !== location.parent.pos)
&& preferences.includeCompletionsWithSnippetText
&& preferences.jsxAttributeCompletionStyle
&& preferences.jsxAttributeCompletionStyle !== "none") {
if (kind === ScriptElementKind.jsxAttribute && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
let useBraces = preferences.jsxAttributeCompletionStyle === "braces";
const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);

Expand Down
61 changes: 0 additions & 61 deletions tests/cases/fourslash/jsxAttributeAsTagNameNoSnippet.ts

This file was deleted.

0 comments on commit 27b29cd

Please sign in to comment.