From 92ab3d905bb350781ce6515084c3397b5ffe4fa0 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Thu, 12 Mar 2020 13:08:53 -0700 Subject: [PATCH] Only resolve completion items from commands --- .../Services/TextDocument/Handlers/CompletionHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs b/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs index 104c6bcb6..654f8a92e 100644 --- a/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs +++ b/src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs @@ -95,6 +95,12 @@ public bool CanResolve(CompletionItem value) // Handler for "completionItem/resolve". In VSCode this is fired when a completion item is highlighted in the completion list. public async Task Handle(CompletionItem request, CancellationToken cancellationToken) { + // We currently only support this request for anything that returns a CommandInfo: functions, cmdlets, aliases. + if (request.Kind != CompletionItemKind.Function) + { + return request; + } + // Get the documentation for the function CommandInfo commandInfo = await CommandHelpers.GetCommandInfoAsync(