diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-11-08 09:35:32 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 09:35:32 +1100 |
commit | 91f8bdda2cfb98ffdbce59a600fc3602534d5249 (patch) | |
tree | 31e8946c32119ca68fc5e7fe9de6afc653164ab5 /cli/lsp/completions.rs | |
parent | b6b25671b29133a8a2f1325094dbd871655f8560 (diff) |
fix(lsp): cache unsupported import completion origins (#12661)
Fixes #12621
Diffstat (limited to 'cli/lsp/completions.rs')
-rw-r--r-- | cli/lsp/completions.rs | 22 |
1 files changed, 14 insertions, 8 deletions
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::RegistryStateNotification>( - 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::RegistryStateNotification>( + lsp_custom::RegistryStateNotificationParams { + origin, + suggestions, + }, + ) + .await; + } } } } |