Skip to content

Commit d5200b9

Browse files
committed
Fixed issue with find symbols in workspace not working. Needed to use AbsoluteUri instead of AbsolutePath (thanks @daviwil). Also changed the search from StartsWith to Contains. Not a fuzzy match but better than StartsWith.
1 parent ba1c40e commit d5200b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PowerShellEditorServices.Host/LanguageServer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ private string GetDecoratedSymbolName(SymbolReference symbolReference)
597597
symbolReference.SymbolType == SymbolType.Function ||
598598
symbolReference.SymbolType == SymbolType.Workflow)
599599
{
600-
name += " {}";
600+
name += " { }";
601601
}
602602

603603
return name;
@@ -632,7 +632,7 @@ protected async Task HandleWorkspaceSymbolRequest(
632632
ContainerName = containerName,
633633
Kind = r.SymbolType == SymbolType.Variable ? SymbolKind.Variable : SymbolKind.Function,
634634
Location = new Location {
635-
Uri = new Uri(r.FilePath).AbsolutePath,
635+
Uri = new Uri(r.FilePath).AbsoluteUri,
636636
Range = GetRangeFromScriptRegion(r.ScriptRegion)
637637
},
638638
Name = GetDecoratedSymbolName(r)
@@ -648,7 +648,7 @@ protected async Task HandleWorkspaceSymbolRequest(
648648

649649
private bool IsQueryMatch(string query, string symbolName)
650650
{
651-
return symbolName.StartsWith(query, StringComparison.OrdinalIgnoreCase);
651+
return symbolName.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0;
652652
}
653653

654654
protected async Task HandleEvaluateRequest(

0 commit comments

Comments
 (0)