From 06778e4e9b0a856ac39cc01f0813e6076eb150d6 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 16 Oct 2024 17:05:13 +0100 Subject: feat(lsp): "deno/didRefreshDenoConfigurationTree" notifications (#26215) --- cli/lsp/lsp_custom.rs | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'cli/lsp/lsp_custom.rs') diff --git a/cli/lsp/lsp_custom.rs b/cli/lsp/lsp_custom.rs index 5f485db7a..b570b6d0e 100644 --- a/cli/lsp/lsp_custom.rs +++ b/cli/lsp/lsp_custom.rs @@ -46,6 +46,30 @@ pub struct DiagnosticBatchNotificationParams { pub messages_len: usize, } +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DenoConfigurationData { + pub scope_uri: lsp::Uri, + pub workspace_root_scope_uri: Option, + pub deno_json: Option, + pub package_json: Option, +} + +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidRefreshDenoConfigurationTreeNotificationParams { + pub data: Vec, +} + +pub enum DidRefreshDenoConfigurationTreeNotification {} + +impl lsp::notification::Notification + for DidRefreshDenoConfigurationTreeNotification +{ + type Params = DidRefreshDenoConfigurationTreeNotificationParams; + const METHOD: &'static str = "deno/didRefreshDenoConfigurationTree"; +} + #[derive(Debug, Eq, Hash, PartialEq, Copy, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub enum DenoConfigurationChangeType { @@ -88,13 +112,15 @@ pub struct DidChangeDenoConfigurationNotificationParams { pub changes: Vec, } +// TODO(nayeemrmn): This is being replaced by +// `DidRefreshDenoConfigurationTreeNotification` for Deno > v2.0.0. Remove it +// soon. pub enum DidChangeDenoConfigurationNotification {} impl lsp::notification::Notification for DidChangeDenoConfigurationNotification { type Params = DidChangeDenoConfigurationNotificationParams; - const METHOD: &'static str = "deno/didChangeDenoConfiguration"; } @@ -102,7 +128,6 @@ pub enum DidUpgradeCheckNotification {} impl lsp::notification::Notification for DidUpgradeCheckNotification { type Params = DidUpgradeCheckNotificationParams; - const METHOD: &'static str = "deno/didUpgradeCheck"; } @@ -125,6 +150,5 @@ pub enum DiagnosticBatchNotification {} impl lsp::notification::Notification for DiagnosticBatchNotification { type Params = DiagnosticBatchNotificationParams; - const METHOD: &'static str = "deno/internalTestDiagnosticBatch"; } -- cgit v1.2.3 From 1fd8d092eafc168af779040e93129d14e5a7187d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 16 Oct 2024 20:05:47 +0100 Subject: =?UTF-8?q?Revert=20"feat(lsp):=20"deno/didRefreshDenoConfiguratio?= =?UTF-8?q?nTree"=20notificatio=E2=80=A6=20(#26320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ns (#26215)" This reverts commit 06778e4e9b0a856ac39cc01f0813e6076eb150d6 because benchmarks are failing on `main`. --- cli/lsp/lsp_custom.rs | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'cli/lsp/lsp_custom.rs') diff --git a/cli/lsp/lsp_custom.rs b/cli/lsp/lsp_custom.rs index b570b6d0e..5f485db7a 100644 --- a/cli/lsp/lsp_custom.rs +++ b/cli/lsp/lsp_custom.rs @@ -46,30 +46,6 @@ pub struct DiagnosticBatchNotificationParams { pub messages_len: usize, } -#[derive(Debug, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct DenoConfigurationData { - pub scope_uri: lsp::Uri, - pub workspace_root_scope_uri: Option, - pub deno_json: Option, - pub package_json: Option, -} - -#[derive(Debug, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct DidRefreshDenoConfigurationTreeNotificationParams { - pub data: Vec, -} - -pub enum DidRefreshDenoConfigurationTreeNotification {} - -impl lsp::notification::Notification - for DidRefreshDenoConfigurationTreeNotification -{ - type Params = DidRefreshDenoConfigurationTreeNotificationParams; - const METHOD: &'static str = "deno/didRefreshDenoConfigurationTree"; -} - #[derive(Debug, Eq, Hash, PartialEq, Copy, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub enum DenoConfigurationChangeType { @@ -112,15 +88,13 @@ pub struct DidChangeDenoConfigurationNotificationParams { pub changes: Vec, } -// TODO(nayeemrmn): This is being replaced by -// `DidRefreshDenoConfigurationTreeNotification` for Deno > v2.0.0. Remove it -// soon. pub enum DidChangeDenoConfigurationNotification {} impl lsp::notification::Notification for DidChangeDenoConfigurationNotification { type Params = DidChangeDenoConfigurationNotificationParams; + const METHOD: &'static str = "deno/didChangeDenoConfiguration"; } @@ -128,6 +102,7 @@ pub enum DidUpgradeCheckNotification {} impl lsp::notification::Notification for DidUpgradeCheckNotification { type Params = DidUpgradeCheckNotificationParams; + const METHOD: &'static str = "deno/didUpgradeCheck"; } @@ -150,5 +125,6 @@ pub enum DiagnosticBatchNotification {} impl lsp::notification::Notification for DiagnosticBatchNotification { type Params = DiagnosticBatchNotificationParams; + const METHOD: &'static str = "deno/internalTestDiagnosticBatch"; } -- cgit v1.2.3 From 72dd74d83a89d3db17e6ed5d0b8c7f4ba3f3d233 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 16 Oct 2024 22:43:26 +0100 Subject: Reland feat(lsp): deno/didRefreshDenoConfigurationTree notifications (#26325) --- cli/lsp/lsp_custom.rs | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'cli/lsp/lsp_custom.rs') diff --git a/cli/lsp/lsp_custom.rs b/cli/lsp/lsp_custom.rs index 5f485db7a..b570b6d0e 100644 --- a/cli/lsp/lsp_custom.rs +++ b/cli/lsp/lsp_custom.rs @@ -46,6 +46,30 @@ pub struct DiagnosticBatchNotificationParams { pub messages_len: usize, } +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DenoConfigurationData { + pub scope_uri: lsp::Uri, + pub workspace_root_scope_uri: Option, + pub deno_json: Option, + pub package_json: Option, +} + +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidRefreshDenoConfigurationTreeNotificationParams { + pub data: Vec, +} + +pub enum DidRefreshDenoConfigurationTreeNotification {} + +impl lsp::notification::Notification + for DidRefreshDenoConfigurationTreeNotification +{ + type Params = DidRefreshDenoConfigurationTreeNotificationParams; + const METHOD: &'static str = "deno/didRefreshDenoConfigurationTree"; +} + #[derive(Debug, Eq, Hash, PartialEq, Copy, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub enum DenoConfigurationChangeType { @@ -88,13 +112,15 @@ pub struct DidChangeDenoConfigurationNotificationParams { pub changes: Vec, } +// TODO(nayeemrmn): This is being replaced by +// `DidRefreshDenoConfigurationTreeNotification` for Deno > v2.0.0. Remove it +// soon. pub enum DidChangeDenoConfigurationNotification {} impl lsp::notification::Notification for DidChangeDenoConfigurationNotification { type Params = DidChangeDenoConfigurationNotificationParams; - const METHOD: &'static str = "deno/didChangeDenoConfiguration"; } @@ -102,7 +128,6 @@ pub enum DidUpgradeCheckNotification {} impl lsp::notification::Notification for DidUpgradeCheckNotification { type Params = DidUpgradeCheckNotificationParams; - const METHOD: &'static str = "deno/didUpgradeCheck"; } @@ -125,6 +150,5 @@ pub enum DiagnosticBatchNotification {} impl lsp::notification::Notification for DiagnosticBatchNotification { type Params = DiagnosticBatchNotificationParams; - const METHOD: &'static str = "deno/internalTestDiagnosticBatch"; } -- cgit v1.2.3