Skip to content

Commit 0f6b0a7

Browse files
authored
Don’t look in JSExportAssignment and CommonJSExport for nodes (#1886)
1 parent 2ad9453 commit 0f6b0a7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

internal/ast/utilities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,7 @@ func GetNodeAtPosition(file *SourceFile, position int, includeJSDoc bool) *Node
26412641
}
26422642
if child == nil {
26432643
current.ForEachChild(func(node *Node) bool {
2644-
if nodeContainsPosition(node, position) {
2644+
if nodeContainsPosition(node, position) && node.Kind != KindJSExportAssignment && node.Kind != KindCommonJSExport {
26452645
child = node
26462646
return true
26472647
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @checkJs: true
2+
// @noEmit: true
3+
// @noTypesAndSymbols: true
4+
5+
// @Filename: a.js
6+
/** @typedef {string} A */
7+
8+
// @Filename: b.js
9+
module.exports = {
10+
create() {
11+
/** @param {import("./a").A} x */
12+
function f(x) {}
13+
return f("hi");
14+
}
15+
}

0 commit comments

Comments
 (0)