Fix completions triggered on existing private identifier property access (#36191)

This commit is contained in:
Andrew Branch
2020-01-15 13:13:11 -08:00
committed by GitHub
parent a9cbea4259
commit 81a942e7b9
2 changed files with 22 additions and 1 deletions

View File

@@ -877,7 +877,7 @@ namespace ts.Completions {
// Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS|
// Skip this partial identifier and adjust the contextToken to the token that precedes it.
if (contextToken && position <= contextToken.end && (isIdentifier(contextToken) || isKeyword(contextToken.kind))) {
if (contextToken && position <= contextToken.end && (isIdentifierOrPrivateIdentifier(contextToken) || isKeyword(contextToken.kind))) {
const start = timestamp();
contextToken = findPrecedingToken(contextToken.getFullStart(), sourceFile, /*startNode*/ undefined)!; // TODO: GH#18217
log("getCompletionData: Get previous token 2: " + (timestamp() - start));