Skip to content

Commit f1fc140

Browse files
Fix jump to definition from outline
By starting at the start of `NameRegion`. Co-authored-by: Frode Flaten <[email protected]>
1 parent c2169ed commit f1fc140

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PowerShellEditorServices/Services/TextDocument/Handlers/DocumentSymbolHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public override async Task<SymbolInformationOrDocumentSymbolContainer> Handle(Do
9292
Location = new Location
9393
{
9494
Uri = DocumentUri.From(r.FilePath),
95-
Range = r.ScriptRegion.ToRange() // The whole thing, not just the name.
95+
Range = new Range(r.NameRegion.ToRange().Start, r.ScriptRegion.ToRange().End) // Jump to name start, but keep whole range to support symbol tree in outline
9696
},
9797
Name = r.DisplayString
9898
}));

0 commit comments

Comments
 (0)