From b38ec73290b4e4bc4f647d1753c86a8b63e131b5 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Fri, 7 Dec 2018 16:23:24 +0800 Subject: [PATCH 1/2] Fix the bug that clicking on node will navigate to the comments --- src/views/documentSymbolNode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/documentSymbolNode.ts b/src/views/documentSymbolNode.ts index 7d014af4..8cc33d37 100644 --- a/src/views/documentSymbolNode.ts +++ b/src/views/documentSymbolNode.ts @@ -34,6 +34,6 @@ export class DocumentSymbolNode extends BaseSymbolNode { } protected get range(): Range { - return (this.symbolInfo).range; + return (this.symbolInfo).selectionRange; } } From b49acea2feb2c185d8349b499ef4b63cfba34203 Mon Sep 17 00:00:00 2001 From: Sheng Chen Date: Mon, 10 Dec 2018 10:03:55 +0800 Subject: [PATCH 2/2] Add a comment --- src/views/documentSymbolNode.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/documentSymbolNode.ts b/src/views/documentSymbolNode.ts index 8cc33d37..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 { + // Using `selectionRange` instead of `range` to make sure the cursor will be pointing to the codes, not the comments return (this.symbolInfo).selectionRange; } }