diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-10-16 22:43:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-16 22:43:26 +0100 |
commit | 72dd74d83a89d3db17e6ed5d0b8c7f4ba3f3d233 (patch) | |
tree | c2344262cbfdb824eacd712744cc805c6e96321c /cli/lsp/lsp_custom.rs | |
parent | f8417224eb9cbc2e4ae134ae197670a0bc53df2e (diff) |
Reland feat(lsp): deno/didRefreshDenoConfigurationTree notifications (#26325)
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"; } |