Skip to content

Commit

Permalink
fix: ignore import specifier extension
Browse files Browse the repository at this point in the history
  • Loading branch information
elyukai committed Mar 16, 2022
1 parent ca7f49b commit 7d2c9ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ast.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EOL } from "os"
import { extname } from "path"
import ts from "typescript"

export namespace JSDoc {
Expand Down Expand Up @@ -614,12 +615,17 @@ const nodeToAst = (node: ts.Node, checker: ts.TypeChecker, typeArguments: { [nam
.getText()
.replace(/^["'](.+)["']$/, "$1")

const extensionlessExternalFilePath =
externalFilePath
? externalFilePath.slice(0, -extname(externalFilePath).length)
: undefined

return {
kind: NodeKind.Reference,
jsDoc,
name,
parentGroup,
externalFilePath,
externalFilePath: extensionlessExternalFilePath,
}
}
}
Expand Down

0 comments on commit 7d2c9ff

Please sign in to comment.