diff --git a/src/views/documentSymbolNode.ts b/src/views/documentSymbolNode.ts index 7d014af4..6e0fb62d 100644 --- a/src/views/documentSymbolNode.ts +++ b/src/views/documentSymbolNode.ts @@ -34,6 +34,7 @@ export class DocumentSymbolNode extends BaseSymbolNode { } protected get range(): Range { - return (this.symbolInfo).range; + // Using `selectionRange` instead of `range` to make sure the cursor will be pointing to the codes, not the comments + return (this.symbolInfo).selectionRange; } }