Skip to content

Commit

Permalink
Cherry-pick PR #46767 into release-4.5 (#46769)
Browse files Browse the repository at this point in the history
Component commits:
1c07983 Removed replacement from jsx completions

20c24b9 Fixed tests

Co-authored-by: Armando Aguirre <[email protected]>
  • Loading branch information
TypeScript Bot and armanio123 authored Nov 11, 2021
1 parent 3278641 commit ec158f9
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 ec158f9

Please sign in to comment.