diff options
author | Jason <m.jason.liu@outlook.com> | 2022-04-03 12:17:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-03 14:17:30 +1000 |
commit | a6e4b4297d840e9cfe4bdf373f24da8202f58e2d (patch) | |
tree | 9de6209eaa5affc810bc5bd9d7cc65384d55a9f3 /cli/lsp/client.rs | |
parent | 6c25b5135dfa6d9be35f6993e4b43d442977eff9 (diff) |
refactor(lsp): migrate from lspower back to tower-lsp (#14163)
Diffstat (limited to 'cli/lsp/client.rs')
-rw-r--r-- | cli/lsp/client.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/cli/lsp/client.rs b/cli/lsp/client.rs index b5728961f..25c97d9d5 100644 --- a/cli/lsp/client.rs +++ b/cli/lsp/client.rs @@ -8,8 +8,8 @@ use deno_core::error::AnyError; use deno_core::futures::future; use deno_core::serde_json; use deno_core::serde_json::Value; -use lspower::lsp; -use lspower::lsp::ConfigurationItem; +use tower_lsp::lsp_types as lsp; +use tower_lsp::lsp_types::ConfigurationItem; use crate::lsp::repl::get_repl_workspace_settings; @@ -35,8 +35,8 @@ impl std::fmt::Debug for Client { } impl Client { - pub fn from_lspower(client: lspower::Client) -> Self { - Self(Arc::new(LspowerClient(client))) + pub fn from_tower(client: tower_lsp::Client) -> Self { + Self(Arc::new(TowerClient(client))) } pub fn new_for_repl() -> Self { @@ -148,9 +148,9 @@ trait ClientTrait: Send + Sync { } #[derive(Clone)] -struct LspowerClient(lspower::Client); +struct TowerClient(tower_lsp::Client); -impl ClientTrait for LspowerClient { +impl ClientTrait for TowerClient { fn publish_diagnostics( &self, uri: lsp::Url, @@ -170,9 +170,7 @@ impl ClientTrait for LspowerClient { let client = self.0.clone(); Box::pin(async move { client - .send_custom_notification::<lsp_custom::RegistryStateNotification>( - params, - ) + .send_notification::<lsp_custom::RegistryStateNotification>(params) .await }) } @@ -183,18 +181,18 @@ impl ClientTrait for LspowerClient { match notification { TestingNotification::Module(params) => { client - .send_custom_notification::<testing_lsp_custom::TestModuleNotification>( + .send_notification::<testing_lsp_custom::TestModuleNotification>( params, ) .await } TestingNotification::DeleteModule(params) => client - .send_custom_notification::<testing_lsp_custom::TestModuleDeleteNotification>( + .send_notification::<testing_lsp_custom::TestModuleDeleteNotification>( params, ) .await, TestingNotification::Progress(params) => client - .send_custom_notification::<testing_lsp_custom::TestRunProgressNotification>( + .send_notification::<testing_lsp_custom::TestRunProgressNotification>( params, ) .await, |