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
commit c8d937ecd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)) {

View File

@ -0,0 +1,12 @@
/// <reference path="fourslash.ts" />
//// interface X {
//// bla: string;
//// }
//// class Y implements X {
//// private blub = "";
//// /**/
//// }
verify.completions({ marker: "", includes: "bla", isNewIdentifierLocation: true });