mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #19401 from Microsoft/fix19349
Remove escaped names of well known symbols from string completions
This commit is contained in:
@@ -1839,6 +1839,18 @@ namespace ts.Completions {
|
||||
}
|
||||
}
|
||||
|
||||
// If the symbol is for a member of an object type and is the internal name of an ES
|
||||
// symbol, it is not a valid entry. Internal names for ES symbols start with "__@"
|
||||
if (symbol.flags & SymbolFlags.ClassMember) {
|
||||
const escapedName = symbol.escapedName as string;
|
||||
if (escapedName.length >= 3 &&
|
||||
escapedName.charCodeAt(0) === CharacterCodes._ &&
|
||||
escapedName.charCodeAt(1) === CharacterCodes._ &&
|
||||
escapedName.charCodeAt(2) === CharacterCodes.at) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface SymbolConstructor {
|
||||
//// readonly species: symbol;
|
||||
////}
|
||||
////var Symbol: SymbolConstructor;
|
||||
////interface PromiseConstructor {
|
||||
//// [Symbol.species]: PromiseConstructor;
|
||||
////}
|
||||
////var Promise: PromiseConstructor;
|
||||
////Promise["/*1*/"];
|
||||
|
||||
goTo.marker('1');
|
||||
verify.not.completionListContains("__@species");
|
||||
Reference in New Issue
Block a user