From 91f8bdda2cfb98ffdbce59a600fc3602534d5249 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Mon, 8 Nov 2021 09:35:32 +1100 Subject: fix(lsp): cache unsupported import completion origins (#12661) Fixes #12621 --- cli/lsp/completions.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'cli/lsp/completions.rs') diff --git a/cli/lsp/completions.rs b/cli/lsp/completions.rs index 4931b5560..601ebb52b 100644 --- a/cli/lsp/completions.rs +++ b/cli/lsp/completions.rs @@ -70,14 +70,20 @@ async fn check_auto_config_registry( .check_origin(&origin) .await .is_ok(); - client - .send_custom_notification::( - lsp_custom::RegistryStateNotificationParams { - origin, - suggestions, - }, - ) - .await; + // we are only sending registry state when enabled now, but changing + // the custom notification would make older versions of the plugin + // incompatible. + // TODO(@kitsonk) clean up protocol when doing v2 of suggestions + if suggestions { + client + .send_custom_notification::( + lsp_custom::RegistryStateNotificationParams { + origin, + suggestions, + }, + ) + .await; + } } } } -- cgit v1.2.3