Merge pull request #9159 from Microsoft/code_completion_escaping
Code completion escaping
This commit is contained in:
commit
13a0f5905d
|
@ -717,6 +717,8 @@ namespace FourSlash {
|
|||
public verifyCompletionEntryDetails(entryName: string, expectedText: string, expectedDocumentation?: string, kind?: string) {
|
||||
const details = this.getCompletionEntryDetails(entryName);
|
||||
|
||||
assert(details, "no completion entry available");
|
||||
|
||||
assert.equal(ts.displayPartsToString(details.displayParts), expectedText, this.assertionMessageAtLastKnownMarker("completion entry details text"));
|
||||
|
||||
if (expectedDocumentation !== undefined) {
|
||||
|
|
|
@ -4141,7 +4141,7 @@ namespace ts {
|
|||
|
||||
if (!uniqueNames[name]) {
|
||||
uniqueNames[name] = name;
|
||||
const displayName = getCompletionEntryDisplayName(name, target, /*performCharacterChecks*/ true);
|
||||
const displayName = getCompletionEntryDisplayName(unescapeIdentifier(name), target, /*performCharacterChecks*/ true);
|
||||
if (displayName) {
|
||||
const entry = {
|
||||
name: displayName,
|
||||
|
|
9
tests/cases/fourslash/codeCompletionEscaping.ts
Normal file
9
tests/cases/fourslash/codeCompletionEscaping.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: a.js
|
||||
// @allowJs: true
|
||||
////___foo; __foo;/**/
|
||||
|
||||
goTo.marker();
|
||||
verify.completionListContains("__foo", undefined, undefined, "warning");
|
||||
verify.completionListContains("___foo", undefined, undefined, "warning");
|
Loading…
Reference in a new issue