Skip to content

Commit 77bf204

Browse files
Merge pull request #39379 from a-tarasyuk/bug/39346
fix(39346): Intelligent code completion not working in child class with composited base interface
2 parents 3593c28 + d137e4a commit 77bf204

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

src/services/completions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2432,7 +2432,7 @@ namespace ts.Completions {
24322432
!existingMemberNames.has(propertySymbol.escapedName) &&
24332433
!!propertySymbol.declarations &&
24342434
!(getDeclarationModifierFlagsFromSymbol(propertySymbol) & ModifierFlags.Private) &&
2435-
!isPrivateIdentifierPropertyDeclaration(propertySymbol.valueDeclaration));
2435+
!(propertySymbol.valueDeclaration && isPrivateIdentifierPropertyDeclaration(propertySymbol.valueDeclaration)));
24362436
}
24372437

24382438
/**
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/// <reference path="fourslash.ts"/>
2+
3+
// @filename: a.ts
4+
////interface I {
5+
//// m2(): void;
6+
//// m3(): void;
7+
////}
8+
////
9+
////type T1 = I;
10+
////export interface A1 extends T1 {
11+
//// m1(): void;
12+
////}
13+
////export class A1 {}
14+
////
15+
////type T2 = Partial<I>
16+
////export interface A2 extends T2 {
17+
//// m1(): void;
18+
////}
19+
////export class A2 {}
20+
////
21+
////type T3 = Pick<I, "m3">
22+
////export interface A3 extends T3 {
23+
//// m1(): void;
24+
////}
25+
////export class A3 {}
26+
27+
// @filename: b.ts
28+
////import { A1, A2, A3 } from './a';
29+
////class B1 extends A1 {
30+
//// /*1*/
31+
////}
32+
////class B2 extends A2 {
33+
//// /*2*/
34+
////}
35+
////class B3 extends A3 {
36+
//// /*3*/
37+
////}
38+
39+
verify.completions(
40+
{ marker: "1", exact: ["m1", "m2", "m3", ...completion.classElementKeywords], isNewIdentifierLocation: true },
41+
{ marker: "2", exact: ["m1", "m2", "m3", ...completion.classElementKeywords], isNewIdentifierLocation: true },
42+
{ marker: "3", exact: ["m1", "m3", ...completion.classElementKeywords], isNewIdentifierLocation: true }
43+
);

0 commit comments

Comments
 (0)