Skip to content

Commit

Permalink
Enable existing commit characters in certain locations where `isNewId…
Browse files Browse the repository at this point in the history
…entifier` is true (#59523)
  • Loading branch information
gabritto authored Aug 19, 2024
1 parent 936a79b commit 1e7889c
Show file tree
Hide file tree
Showing 14 changed files with 91,403 additions and 55 deletions.
8 changes: 4 additions & 4 deletions src/harness/fourslashImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,8 @@ export class TestState {

if (ts.hasProperty(options, "defaultCommitCharacters")) {
assert.deepEqual(
actualCompletions.defaultCommitCharacters?.sort(),
options.defaultCommitCharacters?.sort(),
actualCompletions.defaultCommitCharacters?.slice().sort(),
options.defaultCommitCharacters?.slice().sort(),
"Expected 'defaultCommitCharacters' properties to match",
);
}
Expand Down Expand Up @@ -1191,8 +1191,8 @@ export class TestState {
assert.equal(actual.sortText, expected.sortText || ts.Completions.SortText.LocationPriority, `At entry ${actual.name}: Expected 'sortText' properties to match`);
if (ts.hasProperty(expected, "commitCharacters")) {
assert.deepEqual(
actual.commitCharacters?.sort(),
expected.commitCharacters?.sort(),
actual.commitCharacters?.slice().sort(),
expected.commitCharacters?.slice().sort(),
`At entry ${actual.name}: Expected 'commitCharacters' values to match`,
);
}
Expand Down
155 changes: 115 additions & 40 deletions src/services/completions.ts

Large diffs are not rendered by default.

60 changes: 50 additions & 10 deletions tests/baselines/reference/completionsCommentsClassMembers.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -15330,7 +15330,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -27308,7 +27312,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -45958,7 +45966,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -56488,7 +56500,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -61751,7 +61767,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -69949,7 +69969,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -78147,7 +78171,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -86345,7 +86373,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -90932,7 +90964,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down Expand Up @@ -100829,7 +100865,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -8290,7 +8290,11 @@
]
}
],
"defaultCommitCharacters": []
"defaultCommitCharacters": [
".",
",",
";"
]
}
},
{
Expand Down
Loading

0 comments on commit 1e7889c

Please sign in to comment.