diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-10-16 17:05:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-16 17:05:13 +0100 |
commit | 06778e4e9b0a856ac39cc01f0813e6076eb150d6 (patch) | |
tree | a23e914a91ef0d40c4fe85a5f6a07c91ecc2d491 /cli/lsp/lsp_custom.rs | |
parent | f94cdd1723ebfed265c17fb4def13c9ce17c3e06 (diff) |
feat(lsp): "deno/didRefreshDenoConfigurationTree" notifications (#26215)
Diffstat (limited to 'cli/lsp/lsp_custom.rs')
-rw-r--r-- | cli/lsp/lsp_custom.rs | 30 |
1 files changed, 27 insertions, 3 deletions
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<lsp::Uri>, + pub deno_json: Option<lsp::TextDocumentIdentifier>, + pub package_json: Option<lsp::TextDocumentIdentifier>, +} + +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct DidRefreshDenoConfigurationTreeNotificationParams { + pub data: Vec<DenoConfigurationData>, +} + +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<DenoConfigurationChangeEvent>, } +// 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"; } |