Skip to content

Commit 95ad718

Browse files
committed
Fix the completion when base type is unknown type from unknown namespace
Fixes microsoft#25387
1 parent cb4cb7a commit 95ad718

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/services/completions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,8 +1653,8 @@ namespace ts.Completions {
16531653
if (!(classElementModifierFlags & ModifierFlags.Private)) {
16541654
// List of property symbols of base type that are not private and already implemented
16551655
const baseSymbols = flatMap(getAllSuperTypeNodes(decl), baseTypeNode => {
1656-
const type = typeChecker.getTypeAtLocation(baseTypeNode)!; // TODO: GH#18217
1657-
return typeChecker.getPropertiesOfType(classElementModifierFlags & ModifierFlags.Static ? typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl) : type);
1656+
const type = typeChecker.getTypeAtLocation(baseTypeNode);
1657+
return type && typeChecker.getPropertiesOfType(classElementModifierFlags & ModifierFlags.Static ? typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl) : type);
16581658
});
16591659
symbols = filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags);
16601660
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////class Child extends Namespace.Parent {
4+
//// /**/
5+
////}
6+
7+
goTo.marker("");
8+
verify.completionListContainsClassElementKeywords();
9+
verify.completionListCount(verify.allowedClassElementKeywords.length);

0 commit comments

Comments
 (0)