Skip to content

Commit ada0a9a

Browse files
Only resolve completion items from commands (#1232)
1 parent 612200d commit ada0a9a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ public bool CanResolve(CompletionItem value)
9595
// Handler for "completionItem/resolve". In VSCode this is fired when a completion item is highlighted in the completion list.
9696
public async Task<CompletionItem> Handle(CompletionItem request, CancellationToken cancellationToken)
9797
{
98+
// We currently only support this request for anything that returns a CommandInfo: functions, cmdlets, aliases.
99+
if (request.Kind != CompletionItemKind.Function)
100+
{
101+
return request;
102+
}
103+
98104
// Get the documentation for the function
99105
CommandInfo commandInfo =
100106
await CommandHelpers.GetCommandInfoAsync(

0 commit comments

Comments
 (0)