Skip to content

Commit

Permalink
Fix the import test
Browse files Browse the repository at this point in the history
  • Loading branch information
valerybugakov committed Oct 28, 2022
1 parent af4bb95 commit e62facf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions snapshots/output/syntax/src/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
newFunction() +
// ^^^^^^^^^^^ reference syntax 1.0.0 src/`function.ts`/newFunction().
namespace.a.value
// ^^^^^^^^^ reference local 0
// ^^^^^^^^^ reference syntax 1.0.0 src/`namespace.ts`/
// ^ reference syntax 1.0.0 src/`namespace.ts`/a/
// ^^^^^ reference syntax 1.0.0 src/`namespace.ts`/a/value.
)
Expand All @@ -51,9 +51,9 @@
return import('./function').then(c => c.newFunction())
// ^^^^^^^^^^^^ reference syntax 1.0.0 src/`function.ts`/
// ^^^^ reference typescript 4.8.4 lib/`lib.es5.d.ts`/Promise#then().
// ^ definition local 4
// ^ definition local 3
// documentation ```ts\n(parameter) c: typeof import("/src/function")\n```
// ^ reference local 4
// ^ reference local 3
// ^^^^^^^^^^^ reference syntax 1.0.0 src/`function.ts`/newFunction().
}

6 changes: 5 additions & 1 deletion src/FileIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ export class FileIndexer {
return this.cached(node, this.scipSymbol(node.parent))
}

if (ts.isImportSpecifier(node) || ts.isImportClause(node)) {
if (
ts.isImportSpecifier(node) ||
ts.isImportClause(node) ||
ts.isNamespaceImport(node)
) {
const tpe = this.checker.getTypeAtLocation(node)
for (const declaration of tpe.symbol?.declarations || []) {
return this.scipSymbol(declaration)
Expand Down

0 comments on commit e62facf

Please sign in to comment.