Skip to content

Commit 154deb0

Browse files
Joseph Wattsmheiber
authored andcommitted
Fix display of private names in language server
Signed-off-by: Joseph Watts <[email protected]>
1 parent f4e08c2 commit 154deb0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4856,10 +4856,13 @@ namespace ts {
48564856
context.flags ^= NodeBuilderFlags.InInitialEntityName;
48574857
}
48584858
let firstChar = symbolName.charCodeAt(0);
4859+
48594860
if (isSingleOrDoubleQuote(firstChar) && some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
48604861
return createLiteral(getSpecifierForModuleSymbol(symbol, context));
48614862
}
4862-
const canUsePropertyAccess = isIdentifierStart(firstChar, languageVersion);
4863+
const canUsePropertyAccess = firstChar === CharacterCodes.hash ?
4864+
symbolName.length > 1 && isIdentifierStart(symbolName.charCodeAt(1), languageVersion) :
4865+
isIdentifierStart(firstChar, languageVersion);
48634866
if (index === 0 || canUsePropertyAccess) {
48644867
const identifier = setEmitFlags(createIdentifier(symbolName, typeParameterNodes), EmitFlags.NoAsciiEscaping);
48654868
identifier.symbol = symbol;

0 commit comments

Comments
 (0)