Skip to content

Commit 2ca8ad3

Browse files
Joseph Wattsmheiber
Joseph Watts
authored andcommitted
Fix display of private names in language server
Signed-off-by: Joseph Watts <[email protected]> Signed-off-by: Max Heiber <[email protected]>
1 parent 8050d4f commit 2ca8ad3

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
@@ -4882,10 +4882,13 @@ namespace ts {
48824882
context.flags ^= NodeBuilderFlags.InInitialEntityName;
48834883
}
48844884
let firstChar = symbolName.charCodeAt(0);
4885+
48854886
if (isSingleOrDoubleQuote(firstChar) && some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
48864887
return createLiteral(getSpecifierForModuleSymbol(symbol, context));
48874888
}
4888-
const canUsePropertyAccess = isIdentifierStart(firstChar, languageVersion);
4889+
const canUsePropertyAccess = firstChar === CharacterCodes.hash ?
4890+
symbolName.length > 1 && isIdentifierStart(symbolName.charCodeAt(1), languageVersion) :
4891+
isIdentifierStart(firstChar, languageVersion);
48894892
if (index === 0 || canUsePropertyAccess) {
48904893
const identifier = setEmitFlags(createIdentifier(symbolName, typeParameterNodes), EmitFlags.NoAsciiEscaping);
48914894
identifier.symbol = symbol;

0 commit comments

Comments
 (0)