mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
fix(lsp): avoid calling client while holding lock (#18197)
This commit is contained in:
parent
2ca1607027
commit
7070b8ed50
13 changed files with 674 additions and 575 deletions
|
@ -48,7 +48,7 @@ pub struct CompletionItemData {
|
|||
async fn check_auto_config_registry(
|
||||
url_str: &str,
|
||||
config: &ConfigSnapshot,
|
||||
client: Client,
|
||||
client: &Client,
|
||||
module_registries: &ModuleRegistry,
|
||||
) {
|
||||
// check to see if auto discovery is enabled
|
||||
|
@ -78,14 +78,12 @@ async fn check_auto_config_registry(
|
|||
// incompatible.
|
||||
// TODO(@kitsonk) clean up protocol when doing v2 of suggestions
|
||||
if suggestions {
|
||||
client
|
||||
.send_registry_state_notification(
|
||||
lsp_custom::RegistryStateNotificationParams {
|
||||
origin,
|
||||
suggestions,
|
||||
},
|
||||
)
|
||||
.await;
|
||||
client.send_registry_state_notification(
|
||||
lsp_custom::RegistryStateNotificationParams {
|
||||
origin,
|
||||
suggestions,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +137,7 @@ pub async fn get_import_completions(
|
|||
specifier: &ModuleSpecifier,
|
||||
position: &lsp::Position,
|
||||
config: &ConfigSnapshot,
|
||||
client: Client,
|
||||
client: &Client,
|
||||
module_registries: &ModuleRegistry,
|
||||
documents: &Documents,
|
||||
maybe_import_map: Option<Arc<ImportMap>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue