Merge pull request #9159 from Microsoft/code_completion_escaping

Code completion escaping
This commit is contained in:
Andy
2016-06-14 10:21:40 -07:00
committed by GitHub
3 changed files with 12 additions and 1 deletions
+2
View File
@@ -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) {
+1 -1
View File
@@ -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,
@@ -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");