Skip to content

Commit 6114c38

Browse files
Update intellisense logging
Now shows word to complete and match count instead of the literal type name for `SMA.CommandCompletion`.
1 parent 8aa9e11 commit 6114c38

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/PowerShellEditorServices/Services/Symbols/Vistors/AstOperations.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,15 @@ await executionService.ExecuteDelegateAsync(
127127
.ConfigureAwait(false);
128128

129129
stopwatch.Stop();
130-
logger.LogTrace($"IntelliSense completed in {stopwatch.ElapsedMilliseconds}ms: {commandCompletion}");
130+
logger.LogTrace(
131+
"IntelliSense completed in {elapsed}ms - WordToComplete: \"{word}\" MatchCount: {count}",
132+
stopwatch.ElapsedMilliseconds,
133+
commandCompletion.ReplacementLength > 0
134+
? scriptAst.Extent.StartScriptPosition.GetFullScript()?.Substring(
135+
commandCompletion.ReplacementIndex,
136+
commandCompletion.ReplacementLength)
137+
: null,
138+
commandCompletion.CompletionMatches.Count);
131139

132140
return commandCompletion;
133141
}

0 commit comments

Comments
 (0)