Fix the completion when base type is unknown type from unknown namespace

Fixes #25387
This commit is contained in:
Sheetal Nandi 2018-07-03 12:09:50 -07:00
parent cb4cb7a75f
commit 95ad71864b
2 changed files with 11 additions and 2 deletions

View file

@ -1653,8 +1653,8 @@ namespace ts.Completions {
if (!(classElementModifierFlags & ModifierFlags.Private)) {
// List of property symbols of base type that are not private and already implemented
const baseSymbols = flatMap(getAllSuperTypeNodes(decl), baseTypeNode => {
const type = typeChecker.getTypeAtLocation(baseTypeNode)!; // TODO: GH#18217
return typeChecker.getPropertiesOfType(classElementModifierFlags & ModifierFlags.Static ? typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl) : type);
const type = typeChecker.getTypeAtLocation(baseTypeNode);
return type && typeChecker.getPropertiesOfType(classElementModifierFlags & ModifierFlags.Static ? typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl) : type);
});
symbols = filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags);
}

View file

@ -0,0 +1,9 @@
/// <reference path="fourslash.ts" />
////class Child extends Namespace.Parent {
//// /**/
////}
goTo.marker("");
verify.completionListContainsClassElementKeywords();
verify.completionListCount(verify.allowedClassElementKeywords.length);