From f6a87ecc4b4487f0c2d0b17958eaa8042e8c18a2 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Wed, 18 Nov 2020 16:02:17 +0000 Subject: [PATCH] Capture editor.action.triggerSuggest to avoid errors (#308) --- langserver/handlers/execute_command.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/langserver/handlers/execute_command.go b/langserver/handlers/execute_command.go index a11c00ca..3b785035 100644 --- a/langserver/handlers/execute_command.go +++ b/langserver/handlers/execute_command.go @@ -44,6 +44,13 @@ func (h executeCommandHandlers) Get(name, commandPrefix string) (executeCommandH } func (lh *logHandler) WorkspaceExecuteCommand(ctx context.Context, params lsp.ExecuteCommandParams) (interface{}, error) { + if params.Command == "editor.action.triggerSuggest" { + // If this was actually received by the server, it means the client + // does not support explicit suggest triggering, so we fail silently + // TODO: Revisit once https://github.com/microsoft/language-server-protocol/issues/1117 is addressed + return nil, nil + } + commandPrefix, _ := lsctx.CommandPrefix(ctx) handler, ok := handlers.Get(params.Command, commandPrefix) if !ok {