Fix bug: do unescaping in the right place, so that it only affects escaped javascript identifiers

This commit is contained in:
Andy Hanson 2016-06-14 09:39:48 -07:00
parent 1b4b01eed5
commit 6b05ecab5b
2 changed files with 4 additions and 3 deletions

View file

@ -3234,7 +3234,7 @@ namespace ts {
} }
} }
return unescapeIdentifier(name); return name;
} }
function getCompletionData(fileName: string, position: number) { function getCompletionData(fileName: string, position: number) {
@ -4141,7 +4141,7 @@ namespace ts {
if (!uniqueNames[name]) { if (!uniqueNames[name]) {
uniqueNames[name] = name; uniqueNames[name] = name;
const displayName = getCompletionEntryDisplayName(name, target, /*performCharacterChecks*/ true); const displayName = getCompletionEntryDisplayName(unescapeIdentifier(name), target, /*performCharacterChecks*/ true);
if (displayName) { if (displayName) {
const entry = { const entry = {
name: displayName, name: displayName,

View file

@ -2,7 +2,8 @@
// @Filename: a.js // @Filename: a.js
// @allowJs: true // @allowJs: true
////__foo;/**/ ////___foo; __foo;/**/
goTo.marker(); goTo.marker();
verify.completionListContains("__foo", undefined, undefined, "warning"); verify.completionListContains("__foo", undefined, undefined, "warning");
verify.completionListContains("___foo", undefined, undefined, "warning");