diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-01-28 21:56:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-28 21:56:45 +0000 |
commit | aed5e4997df26c99a186fb9a5b18da3bbc594ed3 (patch) | |
tree | 7f300dd6d4189f86b052a2a47cc18714c6e7157c /cli/lsp | |
parent | 7281775381cda79ef61df27820387dc2c74e0384 (diff) |
chore(lsp): rename client-side command invocations (#22140)
Diffstat (limited to 'cli/lsp')
-rw-r--r-- | cli/lsp/capabilities.rs | 13 | ||||
-rw-r--r-- | cli/lsp/code_lens.rs | 30 | ||||
-rw-r--r-- | cli/lsp/language_server.rs | 19 |
3 files changed, 20 insertions, 42 deletions
diff --git a/cli/lsp/capabilities.rs b/cli/lsp/capabilities.rs index 6ac093254..650fea571 100644 --- a/cli/lsp/capabilities.rs +++ b/cli/lsp/capabilities.rs @@ -39,7 +39,6 @@ fn code_action_capabilities( pub fn server_capabilities( client_capabilities: &ClientCapabilities, - enable_builtin_commands: bool, ) -> ServerCapabilities { let code_action_provider = code_action_capabilities(client_capabilities); ServerCapabilities { @@ -120,14 +119,10 @@ pub fn server_capabilities( document_link_provider: None, color_provider: None, execute_command_provider: Some(ExecuteCommandOptions { - commands: if enable_builtin_commands { - vec![ - "deno.cache".to_string(), - "deno.reloadImportRegistries".to_string(), - ] - } else { - vec![] - }, + commands: vec![ + "deno.cache".to_string(), + "deno.reloadImportRegistries".to_string(), + ], ..Default::default() }), call_hierarchy_provider: Some(CallHierarchyServerCapability::Simple(true)), diff --git a/cli/lsp/code_lens.rs b/cli/lsp/code_lens.rs index 707ff0946..adf1d5c63 100644 --- a/cli/lsp/code_lens.rs +++ b/cli/lsp/code_lens.rs @@ -86,7 +86,7 @@ impl DenoTestCollector { range, command: Some(lsp::Command { title: title.to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!(self.specifier), json!(name.as_ref()), @@ -282,7 +282,7 @@ async fn resolve_implementation_code_lens( }; lsp::Command { title, - command: "deno.showReferences".to_string(), + command: "deno.client.showReferences".to_string(), arguments: Some(vec![ json!(data.specifier), json!(code_lens.range.start), @@ -373,7 +373,7 @@ async fn resolve_references_code_lens( } else { lsp::Command { title, - command: "deno.showReferences".to_string(), + command: "deno.client.showReferences".to_string(), arguments: Some(vec![ json!(data.specifier), json!(code_lens.range.start), @@ -587,7 +587,7 @@ mod tests { }, command: Some(lsp::Command { title: "▶\u{fe0e} Run Test".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test a"), @@ -611,7 +611,7 @@ mod tests { }, command: Some(lsp::Command { title: "Debug".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test a"), @@ -635,7 +635,7 @@ mod tests { }, command: Some(lsp::Command { title: "▶\u{fe0e} Run Test".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("useFnName"), @@ -659,7 +659,7 @@ mod tests { }, command: Some(lsp::Command { title: "Debug".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("useFnName"), @@ -683,7 +683,7 @@ mod tests { }, command: Some(lsp::Command { title: "▶\u{fe0e} Run Test".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test b"), @@ -707,7 +707,7 @@ mod tests { }, command: Some(lsp::Command { title: "Debug".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test b"), @@ -731,7 +731,7 @@ mod tests { }, command: Some(lsp::Command { title: "▶\u{fe0e} Run Test".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test ignore"), @@ -755,7 +755,7 @@ mod tests { }, command: Some(lsp::Command { title: "Debug".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test ignore"), @@ -779,7 +779,7 @@ mod tests { }, command: Some(lsp::Command { title: "▶\u{fe0e} Run Test".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test only"), @@ -803,7 +803,7 @@ mod tests { }, command: Some(lsp::Command { title: "Debug".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test only"), @@ -827,7 +827,7 @@ mod tests { }, command: Some(lsp::Command { title: "▶\u{fe0e} Run Test".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test template literal name"), @@ -851,7 +851,7 @@ mod tests { }, command: Some(lsp::Command { title: "Debug".to_string(), - command: "deno.test".to_string(), + command: "deno.client.test".to_string(), arguments: Some(vec![ json!("https://deno.land/x/mod.ts"), json!("test template literal name"), diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index f55610b1c..31bd5ba8f 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -1216,24 +1216,7 @@ impl Inner { parent_process_checker::start(parent_pid) } - // TODO(nayeemrmn): This flag exists to avoid breaking the extension for the - // 1.37.0 release. Eventually make this always true. - // See https://github.com/denoland/deno/pull/20111#issuecomment-1705776794. - let mut enable_builtin_commands = false; - if let Some(value) = ¶ms.initialization_options { - if let Some(object) = value.as_object() { - if let Some(value) = object.get("enableBuiltinCommands") { - if value.as_bool() == Some(true) { - enable_builtin_commands = true; - } - } - } - } - - let capabilities = capabilities::server_capabilities( - ¶ms.capabilities, - enable_builtin_commands, - ); + let capabilities = capabilities::server_capabilities(¶ms.capabilities); let version = format!( "{} ({}, {})", |