Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion snapshots/input/syntax/src/import.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as ts from 'typescript'
import { Class } from './class'
import { Enum } from './enum'
import { newFunction } from './function'
Expand All @@ -8,7 +9,8 @@ export function useEverything(): string {
new Class('a').classProperty +
renamedInterface().methodSignature('a') +
Enum[Enum.A] +
newFunction()
newFunction() +
ts.SyntaxKind.ArrayType
)
}

Expand Down
11 changes: 9 additions & 2 deletions snapshots/output/syntax/src/import.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Class } from './class'
import * as ts from 'typescript'
// definition syntax 1.0.0 src/`import.ts`/
//documentation ```ts\nmodule "import.ts"\n```
// ^^ reference typescript 4.8.4 lib/`typescript.d.ts`/ts/
// ^^^^^^^^^^^^ reference typescript 4.8.4 lib/`typescript.d.ts`/
import { Class } from './class'
// ^^^^^ reference syntax 1.0.0 src/`class.ts`/Class#
// ^^^^^^^^^ reference syntax 1.0.0 src/`class.ts`/
import { Enum } from './enum'
Expand Down Expand Up @@ -28,8 +31,12 @@
// ^^^^ reference syntax 1.0.0 src/`enum.ts`/Enum#
// ^^^^ reference syntax 1.0.0 src/`enum.ts`/Enum#
// ^ reference syntax 1.0.0 src/`enum.ts`/Enum#A.
newFunction()
newFunction() +
// ^^^^^^^^^^^ reference syntax 1.0.0 src/`function.ts`/newFunction().
ts.SyntaxKind.ArrayType
// ^^ reference typescript 4.8.4 lib/`typescript.d.ts`/ts/
// ^^^^^^^^^^ reference typescript 4.8.4 lib/`typescript.d.ts`/ts/SyntaxKind#
// ^^^^^^^^^ reference typescript 4.8.4 lib/`typescript.d.ts`/ts/SyntaxKind#ArrayType.
)
}

Expand Down
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