Skip to content

Commit 1246f3a

Browse files
CopilotJustinGrote
andauthored
Fix PsesDocumentHighlightHandler log to show count at debug and details at trace level
Agent-Logs-Url: https://github.com/PowerShell/PowerShellEditorServices/sessions/75bc95f1-fc65-4fc4-9ace-752c9d6a517b Co-authored-by: JustinGrote <[email protected]>
1 parent 6410761 commit 1246f3a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,19 @@ public override Task<DocumentHighlightContainer> Handle(
5555
});
5656
}
5757

58-
_logger.LogDebug("Highlights: " + highlights);
58+
_logger.LogDebug("Highlights: {Count} highlight(s) found.", highlights.Count);
59+
if (_logger.IsEnabled(LogLevel.Trace))
60+
{
61+
foreach (DocumentHighlight highlight in highlights)
62+
{
63+
_logger.LogTrace(" Highlight: Kind={Kind}, Range=[({StartLine},{StartChar})-({EndLine},{EndChar})]",
64+
highlight.Kind,
65+
highlight.Range.Start.Line,
66+
highlight.Range.Start.Character,
67+
highlight.Range.End.Line,
68+
highlight.Range.End.Character);
69+
}
70+
}
5971

6072
return cancellationToken.IsCancellationRequested || highlights.Count == 0
6173
? Task.FromResult(s_emptyHighlightContainer)

0 commit comments

Comments
 (0)