Skip to content

Commit

Permalink
Removed replacement from jsx completions (#46767)
Browse files Browse the repository at this point in the history
* Removed replacement from jsx completions

* Fixed tests
  • Loading branch information
armanio123 authored Nov 11, 2021
1 parent b12d5c5 commit 7b86a65
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
4 changes: 0 additions & 4 deletions src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,6 @@ namespace ts.Completions {
insertText = `${escapeSnippetText(name)}={$1}`;
isSnippet = true;
}

if (isSnippet) {
replacementSpan = createTextSpanFromNode(location, sourceFile);
}
}

if (insertText !== undefined && !preferences.includeCompletionsWithInsertText) {
Expand Down
7 changes: 0 additions & 7 deletions tests/cases/fourslash/jsxAttributeCompletionStyleAuto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ verify.completions({
{
name: "prop_b",
insertText: "prop_b=\"$1\"",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_c",
insertText: "prop_c={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_d",
insertText: "prop_d={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_e",
insertText: "prop_e=\"$1\"",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
Expand All @@ -59,13 +55,11 @@ verify.completions({
{
name: "prop_g",
insertText: "prop_g={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_h",
insertText: "prop_h=\"$1\"",
replacementSpan: test.ranges()[0],
isSnippet: true,
sortText: completion.SortText.OptionalMember,
},
Expand All @@ -77,7 +71,6 @@ verify.completions({
{
name: "prop_j",
insertText: "prop_j={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
sortText: completion.SortText.OptionalMember,
}
Expand Down
10 changes: 0 additions & 10 deletions tests/cases/fourslash/jsxAttributeCompletionStyleBraces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,63 +27,53 @@ verify.completions({
{
name: "prop_a",
insertText: "prop_a={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_b",
insertText: "prop_b={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_c",
insertText: "prop_c={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_d",
insertText: "prop_d={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_e",
insertText: "prop_e={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_f",
insertText: "prop_f={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_g",
insertText: "prop_g={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
},
{
name: "prop_h",
insertText: "prop_h={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
sortText: completion.SortText.OptionalMember,
},
{
name: "prop_i",
insertText: "prop_i={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
sortText: completion.SortText.OptionalMember,
},
{
name: "prop_j",
insertText: "prop_j={$1}",
replacementSpan: test.ranges()[0],
isSnippet: true,
sortText: completion.SortText.OptionalMember,
}
Expand Down

0 comments on commit 7b86a65

Please sign in to comment.