mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add helper functions to simplify getCompletionEntryDisplayNameForSymbol (#20552)
This commit is contained in:
@@ -8128,7 +8128,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getLiteralTypeFromPropertyName(prop: Symbol) {
|
||||
return getDeclarationModifierFlagsFromSymbol(prop) & ModifierFlags.NonPublicAccessibilityModifier || startsWith(prop.escapedName as string, "__@") ?
|
||||
return getDeclarationModifierFlagsFromSymbol(prop) & ModifierFlags.NonPublicAccessibilityModifier || isKnownSymbol(prop) ?
|
||||
neverType :
|
||||
getLiteralType(symbolName(prop));
|
||||
}
|
||||
|
||||
@@ -2119,6 +2119,10 @@ namespace ts {
|
||||
return "__@" + symbolName as __String;
|
||||
}
|
||||
|
||||
export function isKnownSymbol(symbol: Symbol): boolean {
|
||||
return startsWith(symbol.escapedName as string, "__@");
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the word "Symbol" with unicode escapes
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user