We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 494b0d9 commit ec8cf7bCopy full SHA for ec8cf7b
src/PowerShellEditorServices/Services/TextDocument/Handlers/DefinitionHandler.cs
@@ -43,6 +43,19 @@ public override async Task<LocationOrLocationLinks> Handle(DefinitionParams requ
43
request.Position.Line + 1,
44
request.Position.Character + 1);
45
46
+ // Short-circuit if we're already on the definition.
47
+ if (foundSymbol.IsDeclaration)
48
+ {
49
+ return new LocationOrLocationLinks(
50
+ new LocationOrLocationLink[] {
51
+ new LocationOrLocationLink(
52
+ new Location
53
54
+ Uri = DocumentUri.From(foundSymbol.FilePath),
55
+ Range = foundSymbol.NameRegion.ToRange()
56
+ })});
57
+ }
58
+
59
List<LocationOrLocationLink> definitionLocations = new();
60
if (foundSymbol is not null)
61
{
0 commit comments