Use Extension trait in ExtensionLspAdapter (#20704)

This PR updates the `ExtensionLspAdapter` to go through the `Extension`
trait for interacting with extensions rather than going through the
`WasmHost` directly.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-14 20:44:57 -05:00 committed by GitHub
parent 332b33716a
commit 1855a312d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 662 additions and 272 deletions

View file

@ -5,7 +5,7 @@ pub mod wasm_host;
#[cfg(test)]
mod extension_store_test;
use crate::{extension_lsp_adapter::ExtensionLspAdapter, wasm_host::wit};
use crate::extension_lsp_adapter::ExtensionLspAdapter;
use anyhow::{anyhow, bail, Context as _, Result};
use async_compression::futures::bufread::GzipDecoder;
use async_tar::Archive;
@ -1238,13 +1238,9 @@ impl ExtensionStore {
this.registration_hooks.register_lsp_adapter(
language.clone(),
ExtensionLspAdapter {
extension: wasm_extension.clone(),
host: this.wasm_host.clone(),
extension: extension.clone(),
language_server_id: language_server_id.clone(),
config: wit::LanguageServerConfig {
name: language_server_id.0.to_string(),
language_name: language.to_string(),
},
language_name: language.clone(),
},
);
}