Skip to content

Commit be18381

Browse files
Removed unnecessary check.
1 parent 97dd855 commit be18381

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/services/services.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,15 +3240,13 @@ namespace ts {
32403240
isMemberCompletion = true;
32413241
isNewIdentifierLocation = false;
32423242

3243-
let importDeclaration = <ImportDeclaration>getAncestor(contextToken, SyntaxKind.ImportDeclaration);
3244-
Debug.assert(importDeclaration !== undefined);
3243+
let importDeclaration = <ImportDeclaration>importClause.parent;
3244+
Debug.assert(importDeclaration !== undefined && importDeclaration.kind === SyntaxKind.ImportDeclaration);
32453245

32463246
let exports: Symbol[];
3247-
if (importDeclaration.moduleSpecifier) {
3248-
let moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier);
3249-
if (moduleSpecifierSymbol) {
3250-
exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
3251-
}
3247+
let moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier);
3248+
if (moduleSpecifierSymbol) {
3249+
exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
32523250
}
32533251

32543252
//let exports = typeInfoResolver.getExportsOfImportDeclaration(importDeclaration);

0 commit comments

Comments
 (0)