Merge pull request #32726 from fuafa/completion-after-private

Fix completion disappear after a property declaration with a private modifier
This commit is contained in:
Daniel Rosenwasser
2019-08-13 11:09:32 -07:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@@ -1566,7 +1566,7 @@ namespace ts.Completions {
// If you're in an interface you don't want to repeat things from super-interface. So just stop here.
if (!isClassLike(decl)) return GlobalsSearch.Success;
const classElement = contextToken.parent;
const classElement = contextToken.kind === SyntaxKind.SemicolonToken ? contextToken.parent.parent : contextToken.parent;
let classElementModifierFlags = isClassElement(classElement) ? getModifierFlags(classElement) : ModifierFlags.None;
// If this is context token is not something we are editing now, consider if this would lead to be modifier
if (contextToken.kind === SyntaxKind.Identifier && !isCurrentlyEditingNode(contextToken)) {