Merge pull request #39379 from a-tarasyuk/bug/39346

fix(39346): Intelligent code completion not working in child class with composited base interface
This commit is contained in:
Daniel Rosenwasser 2020-07-06 11:59:30 -07:00 committed by GitHub
commit 77bf2045d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 1 deletions

View File

@ -2432,7 +2432,7 @@ namespace ts.Completions {
!existingMemberNames.has(propertySymbol.escapedName) &&
!!propertySymbol.declarations &&
!(getDeclarationModifierFlagsFromSymbol(propertySymbol) & ModifierFlags.Private) &&
!isPrivateIdentifierPropertyDeclaration(propertySymbol.valueDeclaration));
!(propertySymbol.valueDeclaration && isPrivateIdentifierPropertyDeclaration(propertySymbol.valueDeclaration)));
}
/**

View File

@ -0,0 +1,43 @@
/// <reference path="fourslash.ts"/>
// @filename: a.ts
////interface I {
//// m2(): void;
//// m3(): void;
////}
////
////type T1 = I;
////export interface A1 extends T1 {
//// m1(): void;
////}
////export class A1 {}
////
////type T2 = Partial<I>
////export interface A2 extends T2 {
//// m1(): void;
////}
////export class A2 {}
////
////type T3 = Pick<I, "m3">
////export interface A3 extends T3 {
//// m1(): void;
////}
////export class A3 {}
// @filename: b.ts
////import { A1, A2, A3 } from './a';
////class B1 extends A1 {
//// /*1*/
////}
////class B2 extends A2 {
//// /*2*/
////}
////class B3 extends A3 {
//// /*3*/
////}
verify.completions(
{ marker: "1", exact: ["m1", "m2", "m3", ...completion.classElementKeywords], isNewIdentifierLocation: true },
{ marker: "2", exact: ["m1", "m2", "m3", ...completion.classElementKeywords], isNewIdentifierLocation: true },
{ marker: "3", exact: ["m1", "m3", ...completion.classElementKeywords], isNewIdentifierLocation: true }
);