Skip to content

Conversation

@joeywatts
Copy link

The language server was displaying private names in the form of A[#privateName] instead of A.#privateName. (One place where this is visible is when you hover over a private name in VSCode.) This change to the checker will use the property access with private names instead of element access.

}
let firstChar = symbolName.charCodeAt(0);
const canUsePropertyAccess = isIdentifierStart(firstChar, languageVersion);
const canUsePropertyAccess = firstChar === CharacterCodes.hash ?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to check the name node itself rather than rely on checking for #. Something like:
isNamedDeclaration(symbol.valueDeclaration) ? isPrivateName(symbol.valueDeclaration.name)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have to use the symbol name because apparently valueDeclaration can be undefined. Making the change to check isNamedDeclaration(valueDeclaration) crashes tons of tests because it's undefined.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{vw}

Joseph Watts added 2 commits December 10, 2018 11:05
@joeywatts joeywatts force-pushed the private-name-server-display branch from 72285d1 to 3fc3756 Compare December 10, 2018 16:20
@Neuroboy23 Neuroboy23 merged commit 979155c into bloomberg:es-private-fields Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants