Skip to content

Commit 4c63db6

Browse files
authored
Fix the bug that clicking on node will navigate the the position which contains comments (#124)
1 parent 4450082 commit 4c63db6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/views/documentSymbolNode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class DocumentSymbolNode extends BaseSymbolNode {
3434
}
3535

3636
protected get range(): Range {
37-
return (<DocumentSymbol>this.symbolInfo).range;
37+
// Using `selectionRange` instead of `range` to make sure the cursor will be pointing to the codes, not the comments
38+
return (<DocumentSymbol>this.symbolInfo).selectionRange;
3839
}
3940
}

0 commit comments

Comments
 (0)