From 2f876b52d15efcb900776a0b56e7f8c751ba4199 Mon Sep 17 00:00:00 2001 From: narumincho <16481886+narumincho@users.noreply.github.com> Date: Tue, 13 May 2025 07:33:38 +0900 Subject: [PATCH] feat(lsp): add description in TaskDefinition (#29244) --- cli/lsp/language_server.rs | 2 ++ cli/lsp/lsp_custom.rs | 1 + tests/integration/lsp_tests.rs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 62ab05ad37..d82ea1d089 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -4755,6 +4755,7 @@ impl Inner { command: def.command.clone(), source_uri: url_to_uri(&config_file.specifier) .map_err(|_| LspError::internal_error())?, + description: def.description.clone(), }); } }; @@ -4767,6 +4768,7 @@ impl Inner { command: Some(command.clone()), source_uri: url_to_uri(&package_json.specifier()) .map_err(|_| LspError::internal_error())?, + description: None, }); } } diff --git a/cli/lsp/lsp_custom.rs b/cli/lsp/lsp_custom.rs index 5800072792..528ff7ddf8 100644 --- a/cli/lsp/lsp_custom.rs +++ b/cli/lsp/lsp_custom.rs @@ -15,6 +15,7 @@ pub const LATEST_DIAGNOSTIC_BATCH_INDEX: &str = pub struct TaskDefinition { pub name: String, pub command: Option, + pub description: Option, pub source_uri: lsp::Uri, } diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 971513c574..0cc8b8720a 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1295,11 +1295,13 @@ fn lsp_deno_task() { { "name": "build", "command": "deno test", + "description": null, "sourceUri": url_to_uri(&temp_dir.url().join("deno.jsonc").unwrap()).unwrap(), }, { "name": "serve", "command": "deno run -RN server.ts", + "description": "Start the dev server", "sourceUri": url_to_uri(&temp_dir.url().join("deno.jsonc").unwrap()).unwrap(), } ])