From 53a9dc510f25cb90e3e022a05c81290644d66931 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 8 Nov 2023 12:58:29 -0800 Subject: [PATCH 01/27] Improve rust builds --- .gitignore | 2 + .vscode/settings.json | 2 +- generator/plugins/rust/rust_commons.py | 14 ++----- packages/rust/lsprotocol/Cargo.toml | 6 +++ packages/rust/lsprotocol/src/lib.rs | 48 +++++++++++----------- tests/rust/Cargo.toml | 15 +++++++ tests/rust/src/main.rs | 57 ++++++++++++++++++++++++++ 7 files changed, 108 insertions(+), 36 deletions(-) create mode 100644 tests/rust/Cargo.toml create mode 100644 tests/rust/src/main.rs diff --git a/.gitignore b/.gitignore index ff69d08..8098f32 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ packages/rust/**/target/ packages/rust/**/Cargo.lock packages/dotnet/lsprotocol/bin/ packages/dotnet/lsprotocol/obj/ +tests/rust/**/target/ +tests/rust/**/Cargo.lock \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 9df63e5..7fb5928 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,5 +19,5 @@ "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, "python.analysis.extraPaths": ["packages/python", "tests/python/common"], - "rust-analyzer.linkedProjects": ["packages/rust/lsprotocol/Cargo.toml"] + "rust-analyzer.linkedProjects": ["packages/rust/lsprotocol/Cargo.toml", "tests/rust/Cargo.toml"] } diff --git a/generator/plugins/rust/rust_commons.py b/generator/plugins/rust/rust_commons.py index 4022e27..4e228d5 100644 --- a/generator/plugins/rust/rust_commons.py +++ b/generator/plugins/rust/rust_commons.py @@ -667,15 +667,7 @@ def generate_extras( ) -> List[str]: extras = [] if type_def.deprecated: - extras = ["#[deprecated]"] - elif type_def.proposed: - if type_def.since: - extras = [f'#[cfg(feature = "proposed", since = "{type_def.since}")]'] - else: - extras = [f'#[cfg(feature = "proposed")]'] - # else: - # if type_def.since: - # extras = [f'#[cfg(feature = "stable", since = "{type_def.since}")]'] - # else: - # extras = [f'#[cfg(feature = "stable")]'] + extras += ["#[deprecated]"] + if type_def.proposed: + extras += ['#[cfg(feature = "proposed")]'] return extras diff --git a/packages/rust/lsprotocol/Cargo.toml b/packages/rust/lsprotocol/Cargo.toml index 4d1ddc9..012d738 100644 --- a/packages/rust/lsprotocol/Cargo.toml +++ b/packages/rust/lsprotocol/Cargo.toml @@ -8,9 +8,15 @@ license = "MIT" repository = "https://github.com/microsoft/lsprotocol" readme = "README.md" +[features] +proposed=[] + [dependencies] serde = {version ="1.0.152", features = ["derive"]} serde_json = "1.0.93" serde_repr = "0.1.10" url = "2.3.1" rust_decimal = "1.29.1" + +[build] +rustflags = "--cfg proposed" \ No newline at end of file diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index d50af4b..377c5be 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -334,12 +334,12 @@ pub enum LSPNotificationMethods { #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] pub enum MessageDirection { - #[serde(rename = "clientToServer")] - ClientToServer, #[serde(rename = "both")] Both, #[serde(rename = "serverToClient")] ServerToClient, + #[serde(rename = "clientToServer")] + ClientToServer, } /// A set of predefined token types. This set is not fixed @@ -942,7 +942,7 @@ pub enum MarkupKind { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] pub enum InlineCompletionTriggerKind { /// Completion was triggered explicitly by a user gesture. @@ -2660,7 +2660,7 @@ pub struct DidCloseNotebookDocumentParams { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InlineCompletionParams { @@ -2682,7 +2682,7 @@ pub struct InlineCompletionParams { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InlineCompletionList { @@ -2694,7 +2694,7 @@ pub struct InlineCompletionList { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InlineCompletionItem { @@ -2715,7 +2715,7 @@ pub struct InlineCompletionItem { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InlineCompletionRegistrationOptions { @@ -3997,7 +3997,7 @@ pub struct DocumentRangeFormattingRegistrationOptions { /// /// @since 3.18.0 /// @proposed - #[cfg(feature = "proposed", since = "3.18.0")] + #[cfg(feature = "proposed")] pub ranges_support: Option, } @@ -4005,7 +4005,7 @@ pub struct DocumentRangeFormattingRegistrationOptions { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct DocumentRangesFormattingParams { @@ -5077,7 +5077,7 @@ pub struct NotebookDocumentIdentifier { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InlineCompletionContext { @@ -5098,7 +5098,7 @@ pub struct InlineCompletionContext { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct StringValue { @@ -5113,7 +5113,7 @@ pub struct StringValue { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InlineCompletionOptions { @@ -5310,7 +5310,7 @@ pub struct ServerCapabilities { /// /// @since 3.18.0 /// @proposed - #[cfg(feature = "proposed", since = "3.18.0")] + #[cfg(feature = "proposed")] pub inline_completion_provider: Option>, /// The server provides inline values. @@ -5819,7 +5819,7 @@ pub struct DocumentRangeFormattingOptions { /// /// @since 3.18.0 /// @proposed - #[cfg(feature = "proposed", since = "3.18.0")] + #[cfg(feature = "proposed")] pub ranges_support: Option, pub work_done_progress: Option, @@ -6073,7 +6073,7 @@ pub struct NotebookCellArrayChange { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct SelectedCompletionInfo { @@ -6384,7 +6384,7 @@ pub struct WorkspaceClientCapabilities { /// /// @since 3.18.0 /// @proposed - #[cfg(feature = "proposed", since = "3.18.0")] + #[cfg(feature = "proposed")] pub folding_range: Option, /// Capabilities specific to the inlay hint requests scoped to the @@ -6488,7 +6488,7 @@ pub struct TextDocumentClientCapabilities { /// /// @since 3.18.0 /// @proposed - #[cfg(feature = "proposed", since = "3.18.0")] + #[cfg(feature = "proposed")] pub inline_completion: Option, /// Capabilities specific to the `textDocument/inlineValue` request. @@ -6895,7 +6895,7 @@ pub struct DiagnosticWorkspaceClientCapabilities { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct FoldingRangeWorkspaceClientCapabilities { @@ -6909,7 +6909,7 @@ pub struct FoldingRangeWorkspaceClientCapabilities { /// /// @since 3.18.0 /// @proposed - #[cfg(feature = "proposed", since = "3.18.0")] + #[cfg(feature = "proposed")] pub refresh_support: Option, } @@ -7369,7 +7369,7 @@ pub struct DocumentRangeFormattingClientCapabilities { /// /// @since 3.18.0 /// @proposed - #[cfg(feature = "proposed", since = "3.18.0")] + #[cfg(feature = "proposed")] pub ranges_support: Option, } @@ -7678,7 +7678,7 @@ pub struct DiagnosticClientCapabilities { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InlineCompletionClientCapabilities { @@ -8400,7 +8400,7 @@ pub struct TextDocumentFoldingRangeResponse { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct WorkspaceFoldingRangeRefreshRequest { @@ -9371,7 +9371,7 @@ pub struct WorkspaceDiagnosticRefreshResponse { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentInlineCompletionRequest { @@ -10273,7 +10273,7 @@ pub struct TextDocumentRangeFormattingResponse { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentRangesFormattingRequest { diff --git a/tests/rust/Cargo.toml b/tests/rust/Cargo.toml new file mode 100644 index 0000000..ca8a508 --- /dev/null +++ b/tests/rust/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "lsprotocol-test" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +glob = "0.3.1" +serde = {version ="1.0.152", features = ["derive"]} +serde_json = "1.0.93" +serde_repr = "0.1.10" +url = "2.3.1" +rust_decimal = "1.29.1" +lsprotocol = { path = "../../packages/rust/lsprotocol", features = ["proposed"]} diff --git a/tests/rust/src/main.rs b/tests/rust/src/main.rs new file mode 100644 index 0000000..4531129 --- /dev/null +++ b/tests/rust/src/main.rs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +use glob::glob; +use lsprotocol::*; +use serde_json::Value; +use std::fs; +use std::path::Path; +use std::str::FromStr; + +const TEST_DATA_ROOT: &str = std::env::var("TEST_DATA_ROOT").unwrap().as_str(); + +fn get_all_json_files(root: &str) -> Vec { + let pattern = format!("{}/**/*.json", root); + glob(&pattern) + .expect("Failed to read glob pattern") + .filter_map(Result::ok) + .map(|path| path.to_str().unwrap().to_string()) + .collect() +} + +fn validate_type(data: &Value) { + match serde_json::from_value::(data.clone()) { + Ok(_) => assert_eq!( + result_type, "True", + "Expected error, but succeeded structuring" + ), + Err(_) => assert_eq!( + result_type, "False", + "Expected success, but failed structuring" + ), + } +} + +fn validate(lsp_type: &str, data: &Value) { + match lsp_type { + "CallHierarchyIncomingCallsRequest" => { + validate_type::(data) + } + _ => (), + } +} + +fn test_generated_data(json_file: &str) { + let type_name_result_type: Vec<&str> = json_file.split("-").collect(); + let lsp_type = type_name_result_type[0]; + let result_type = type_name_result_type[1]; + + let data: Value = serde_json::from_str(&fs::read_to_string(json_file).unwrap()).unwrap(); + + validate(&lsp_type, &data); +} + +fn main() { + for json_file in get_all_json_files(TEST_DATA_ROOT) { + test_generated_data(&json_file); + } +} From bc42a6976aff37c68b3f5f0392f70742bac3d02f Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 8 Nov 2023 15:18:20 -0800 Subject: [PATCH 02/27] Get rust tests running --- tests/rust/src/main.rs | 107 ++++++++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 43 deletions(-) diff --git a/tests/rust/src/main.rs b/tests/rust/src/main.rs index 4531129..702bf8f 100644 --- a/tests/rust/src/main.rs +++ b/tests/rust/src/main.rs @@ -1,57 +1,78 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -use glob::glob; -use lsprotocol::*; -use serde_json::Value; -use std::fs; -use std::path::Path; -use std::str::FromStr; - -const TEST_DATA_ROOT: &str = std::env::var("TEST_DATA_ROOT").unwrap().as_str(); - -fn get_all_json_files(root: &str) -> Vec { - let pattern = format!("{}/**/*.json", root); - glob(&pattern) - .expect("Failed to read glob pattern") - .filter_map(Result::ok) - .map(|path| path.to_str().unwrap().to_string()) - .collect() -} -fn validate_type(data: &Value) { - match serde_json::from_value::(data.clone()) { - Ok(_) => assert_eq!( - result_type, "True", - "Expected error, but succeeded structuring" - ), - Err(_) => assert_eq!( - result_type, "False", - "Expected success, but failed structuring" - ), +#[cfg(test)] +mod tests { + use glob::glob; + use lsprotocol::*; + use serde::Deserialize; + use serde_json::Value; + use std::fs; + + fn get_all_json_files(root: &str) -> Vec { + let pattern = format!("{}/*.json", root); + glob(&pattern) + .expect("Failed to read glob pattern") + .filter_map(Result::ok) + .map(|path| path.to_str().unwrap().to_string()) + .collect() } -} -fn validate(lsp_type: &str, data: &Value) { - match lsp_type { - "CallHierarchyIncomingCallsRequest" => { - validate_type::(data) + fn validate_type Deserialize<'de>>(result_type: &str, data: &Value) { + match serde_json::from_value::(data.clone()) { + Ok(_) => assert_eq!( + result_type, "True", + "Expected error, but succeeded deserializing" + ), + Err(e) => assert_eq!( + result_type, "False", + "Expected success, but failed deserializing: {e}", + ), } - _ => (), } -} -fn test_generated_data(json_file: &str) { - let type_name_result_type: Vec<&str> = json_file.split("-").collect(); - let lsp_type = type_name_result_type[0]; - let result_type = type_name_result_type[1]; + fn validate(lsp_type: &str, result_type: &str, data: &Value) { + match lsp_type { + "CallHierarchyIncomingCallsRequest" => { + return validate_type::(result_type, data) + } - let data: Value = serde_json::from_str(&fs::read_to_string(json_file).unwrap()).unwrap(); + _ => (), + } + } - validate(&lsp_type, &data); + #[test] + + fn test_generated_data() { + println!("Running generated data tests"); + let cwd = std::env::current_dir() + .unwrap() + .join("../../packages/testdata"); + let env_value = + std::env::var("TEST_DATA_ROOT").unwrap_or_else(|_| cwd.to_str().unwrap().to_string()); + println!("TEST_DATA_ROOT: {}", env_value); + for json_file in get_all_json_files(env_value.as_str()) { + let basename = std::path::Path::new(&json_file) + .file_name() + .unwrap() + .to_str() + .unwrap(); + let type_name_result_type: Vec<&str> = basename.split("-").collect(); + let lsp_type = type_name_result_type[0]; + let result_type = type_name_result_type[1]; + println!("Validating: {}", json_file); + let data: Value = + serde_json::from_str(&fs::read_to_string(json_file.clone()).unwrap()).unwrap(); + + validate(&lsp_type, &result_type, &data); + } + } } +use lsprotocol::*; +use std::fs; fn main() { - for json_file in get_all_json_files(TEST_DATA_ROOT) { - test_generated_data(&json_file); - } + // let file_path: String = "".to_string(); + // let data = &fs::read_to_string(file_path.clone()).unwrap(); + // let result: CallHierarchyIncomingCallsRequest = serde_json::from_str(data).unwrap(); } From b16587cd18137873b7d143f4560a0f8894d0fe1e Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 8 Nov 2023 15:38:46 -0800 Subject: [PATCH 03/27] Temp code --- tests/rust/src/main.rs | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/tests/rust/src/main.rs b/tests/rust/src/main.rs index 702bf8f..c54ae5e 100644 --- a/tests/rust/src/main.rs +++ b/tests/rust/src/main.rs @@ -18,8 +18,8 @@ mod tests { .collect() } - fn validate_type Deserialize<'de>>(result_type: &str, data: &Value) { - match serde_json::from_value::(data.clone()) { + fn validate_type Deserialize<'de>>(result_type: &str, data: &str) { + match serde_json::from_str::(data) { Ok(_) => assert_eq!( result_type, "True", "Expected error, but succeeded deserializing" @@ -31,7 +31,7 @@ mod tests { } } - fn validate(lsp_type: &str, result_type: &str, data: &Value) { + fn validate(lsp_type: &str, result_type: &str, data: &str) { match lsp_type { "CallHierarchyIncomingCallsRequest" => { return validate_type::(result_type, data) @@ -61,18 +61,31 @@ mod tests { let lsp_type = type_name_result_type[0]; let result_type = type_name_result_type[1]; println!("Validating: {}", json_file); - let data: Value = - serde_json::from_str(&fs::read_to_string(json_file.clone()).unwrap()).unwrap(); + let data = &fs::read_to_string(json_file.clone()).unwrap(); validate(&lsp_type, &result_type, &data); } } } -use lsprotocol::*; -use std::fs; +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +enum MyEnum { + Something = 1, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +struct MyStruct { + pub kind: MyEnum, +} + fn main() { - // let file_path: String = "".to_string(); - // let data = &fs::read_to_string(file_path.clone()).unwrap(); - // let result: CallHierarchyIncomingCallsRequest = serde_json::from_str(data).unwrap(); + let json_str = "{\"kind\": 1}"; + let _result: MyStruct = serde_json::from_str(json_str).unwrap(); } + +// let file_path: String = "".to_string(); +// let data = &fs::read_to_string(file_path.clone()).unwrap(); +// let result: CallHierarchyIncomingCallsRequest = serde_json::from_str(data).unwrap(); From 5460ccb8d1c35e9432ca0f8fddb231c52085f53b Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 8 Nov 2023 18:48:40 -0800 Subject: [PATCH 04/27] Build and run rust tests --- .github/workflows/pr-check.yml | 35 +- .github/workflows/push-check.yml | 33 +- generator/__main__.py | 10 +- generator/plugins/dotnet/dotnet_utils.py | 2 +- generator/plugins/python/utils.py | 2 +- generator/plugins/rust/rust_enum.py | 49 +- generator/plugins/rust/rust_structs.py | 2 +- generator/plugins/rust/rust_tests.py | 33 + generator/plugins/rust/rust_utils.py | 8 +- .../plugins/testdata/testdata_generator.py | 4 +- generator/plugins/testdata/testdata_utils.py | 3 +- noxfile.py | 10 +- packages/rust/lsprotocol/src/lib.rs | 736 +++++++++++++++++- tests/rust/src/main.rs | 320 +++++++- 14 files changed, 1171 insertions(+), 76 deletions(-) create mode 100644 generator/plugins/rust/rust_tests.py diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 7fdb047..ae7fe19 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -96,7 +96,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout @@ -115,6 +115,37 @@ jobs: run: python -m nox --session tests shell: bash + rust-tests: + name: 'Rust Tests' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Rust Tool Chain setup + uses: dtolnay/rust-toolchain@stable + + - name: Install Generator + run: python -m pip install -r ./requirements.txt + + - name: Generate Test Data + run: python -m generator --plugin testdata + + - name: Rust Run Tests + run: cargo test --manifest-path tests/rust/Cargo.toml + shell: bash + env: + LSP_TEST_DATA_PATH: ${{ github.workspace }}/packages/testdata + dotnet-tests: name: Dotnet Tests runs-on: ${{ matrix.os }} @@ -194,7 +225,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout diff --git a/.github/workflows/push-check.yml b/.github/workflows/push-check.yml index 091402e..6107a00 100644 --- a/.github/workflows/push-check.yml +++ b/.github/workflows/push-check.yml @@ -101,7 +101,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout @@ -120,6 +120,37 @@ jobs: run: python -m nox --session tests shell: bash + rust-tests: + name: 'Rust Tests' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Rust Tool Chain setup + uses: dtolnay/rust-toolchain@stable + + - name: Install Generator + run: python -m pip install -r ./requirements.txt + + - name: Generate Test Data + run: python -m generator --plugin testdata + + - name: Rust Run Tests + run: cargo test --manifest-path tests/rust/Cargo.toml + shell: bash + env: + LSP_TEST_DATA_PATH: ${{ github.workspace }}/packages/testdata + dotnet-tests: name: Dotnet Tests runs-on: ${{ matrix.os }} diff --git a/generator/__main__.py b/generator/__main__.py index 2ebc7d3..5dc1bad 100644 --- a/generator/__main__.py +++ b/generator/__main__.py @@ -17,6 +17,7 @@ from . import model PACKAGES_ROOT = pathlib.Path(__file__).parent.parent / "packages" +TESTS_ROOT = pathlib.Path(__file__).parent.parent / "tests" LOGGER = logging.getLogger("generator") @@ -51,6 +52,12 @@ def get_parser() -> argparse.ArgumentParser: help="Path to a directory where the generated content is written.", type=str, ) + parser.add_argument( + "--test-dir", + "-t", + help="Path to a directory where the generated tests are written.", + type=str, + ) return parser @@ -80,6 +87,7 @@ def main(argv: Sequence[str]) -> None: LOGGER.info(f"Running plugin {plugin}.") output_dir = args.output_dir or os.fspath(PACKAGES_ROOT / plugin) + test_dir = args.test_dir or os.fspath(TESTS_ROOT / plugin) LOGGER.info(f"Writing output to {output_dir}") # load model and generate types for each plugin to avoid @@ -90,7 +98,7 @@ def main(argv: Sequence[str]) -> None: LOGGER.info(f"Loading plugin: {plugin}.") plugin_module = importlib.import_module(f"generator.plugins.{plugin}") LOGGER.info(f"Running plugin: {plugin}.") - plugin_module.generate(spec, output_dir) + plugin_module.generate(spec, output_dir, test_dir) LOGGER.info(f"Plugin {plugin} completed.") except Exception as e: LOGGER.error(f"Error running plugin {plugin}:", exc_info=e) diff --git a/generator/plugins/dotnet/dotnet_utils.py b/generator/plugins/dotnet/dotnet_utils.py index 4510527..1ac49a3 100644 --- a/generator/plugins/dotnet/dotnet_utils.py +++ b/generator/plugins/dotnet/dotnet_utils.py @@ -19,7 +19,7 @@ LOGGER = logging.getLogger("dotnet") -def generate_from_spec(spec: model.LSPModel, output_dir: str) -> None: +def generate_from_spec(spec: model.LSPModel, output_dir: str, _test_dir: str) -> None: """Generate the code for the given spec.""" output_path = pathlib.Path(output_dir, PACKAGE_DIR_NAME) if not output_path.exists(): diff --git a/generator/plugins/python/utils.py b/generator/plugins/python/utils.py index 525e9cb..4b7968a 100644 --- a/generator/plugins/python/utils.py +++ b/generator/plugins/python/utils.py @@ -19,7 +19,7 @@ custom_request_params_aliases = ["WorkspaceConfigurationParams"] -def generate_from_spec(spec: model.LSPModel, output_dir: str) -> None: +def generate_from_spec(spec: model.LSPModel, output_dir: str, test_dir: str) -> None: code = TypesCodeGenerator(spec).get_code() output_path = pathlib.Path(output_dir, PACKAGE_NAME) diff --git a/generator/plugins/rust/rust_enum.py b/generator/plugins/rust/rust_enum.py index 5773d12..b1d60f2 100644 --- a/generator/plugins/rust/rust_enum.py +++ b/generator/plugins/rust/rust_enum.py @@ -14,17 +14,47 @@ def _get_enum_docs(enum: Union[model.Enum, model.EnumItem]) -> List[str]: return lines_to_doc_comments(doc) +def generate_serde(enum: model.Enum) -> List[str]: + ser = [ + f"impl Serialize for {enum.name} " "{", + "fn serialize(&self, serializer: S) -> Result where S: serde::Serializer,{", + "match self {", + ] + + de = [ + f"impl<'de> Deserialize<'de> for {enum.name} " "{", + f"fn deserialize(deserializer: D) -> Result<{enum.name}, D::Error> where D: serde::Deserializer<'de>," + "{", + "let value = i32::deserialize(deserializer)?;", + "match value {", + ] + for item in enum.values: + full_name = f"{enum.name}::{to_upper_camel_case(item.name)}" + ser += [f"{full_name} => serializer.serialize_i32({item.value}),"] + de += [f"{item.value} => Ok({full_name}),"] + ser += [ + "}", # match + "}", # fn + "}", # impl + ] + de += [ + '_ => Err(serde::de::Error::custom("Unexpected value"))', + "}", # match + "}", # fn + "}", # impl + ] + return ser + de + + def generate_enum(enum: model.Enum, types: TypeData) -> None: is_int = all(isinstance(item.value, int) for item in enum.values) - lines = ( - _get_enum_docs(enum) - + generate_extras(enum) - + [ - "#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)]", - f"pub enum {enum.name} " "{", - ] - ) + lines = _get_enum_docs(enum) + generate_extras(enum) + if is_int: + lines += ["#[derive(PartialEq, Debug, Eq, Clone)]"] + else: + lines += ["#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)]"] + lines += [f"pub enum {enum.name} " "{"] for item in enum.values: if is_int: @@ -43,6 +73,9 @@ def generate_enum(enum: model.Enum, types: TypeData) -> None: lines += ["}"] + if is_int: + lines += generate_serde(enum) + types.add_type_info(enum, enum.name, lines) diff --git a/generator/plugins/rust/rust_structs.py b/generator/plugins/rust/rust_structs.py index 571cd62..4481c88 100644 --- a/generator/plugins/rust/rust_structs.py +++ b/generator/plugins/rust/rust_structs.py @@ -213,7 +213,7 @@ def _generate_or_type_alias( for sub_type in alias_def.type.items: if sub_type.kind == "base" and sub_type.name == "null": - inner += [f"None,"] + inner += ["None,"] else: inner += [f"ValueType{index}({get_type_name(sub_type, types, spec)}),"] index += 1 diff --git a/generator/plugins/rust/rust_tests.py b/generator/plugins/rust/rust_tests.py new file mode 100644 index 0000000..ced150a --- /dev/null +++ b/generator/plugins/rust/rust_tests.py @@ -0,0 +1,33 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + + +import pathlib + +import generator.model as model + +from .rust_commons import get_message_type_name + + +def generate_test_code(spec: model.LSPModel, test_path: pathlib.Path) -> str: + """Generate the code for the given spec.""" + lines = [] + for request in spec.requests: + request_name = get_message_type_name(request) + lines += [ + f'"{request_name}" =>' "{", + f"return validate_type::<{request_name}>(result_type, data)", + "}", + ] + for notification in spec.notifications: + notification_name = get_message_type_name(notification) + lines += [ + f'"{notification_name}" =>' "{", + f"return validate_type::<{notification_name}>(result_type, data)", + "}", + ] + + tests = "\n".join(lines) + code = test_path.read_text(encoding="utf-8") + code = code.replace("/*@@_LSP_GENERATED_TESTS_@@*/", tests) + test_path.write_text(code, encoding="utf-8") diff --git a/generator/plugins/rust/rust_utils.py b/generator/plugins/rust/rust_utils.py index d817070..b04363e 100644 --- a/generator/plugins/rust/rust_utils.py +++ b/generator/plugins/rust/rust_utils.py @@ -16,11 +16,12 @@ generate_structures, generate_type_aliases, ) +from .rust_tests import generate_test_code PACKAGE_DIR_NAME = "lsprotocol" -def generate_from_spec(spec: model.LSPModel, output_dir: str) -> None: +def generate_from_spec(spec: model.LSPModel, output_dir: str, test_dir: str) -> None: code = generate_package_code(spec) output_path = pathlib.Path(output_dir, PACKAGE_DIR_NAME) @@ -31,6 +32,11 @@ def generate_from_spec(spec: model.LSPModel, output_dir: str) -> None: for file_name in code: (output_path / file_name).write_text(code[file_name], encoding="utf-8") + # update tests if exists + test_path = pathlib.Path(test_dir) / "src" / "main.rs" + if test_path.exists(): + generate_test_code(spec, test_path) + def generate_package_code(spec: model.LSPModel) -> List[str]: return { diff --git a/generator/plugins/testdata/testdata_generator.py b/generator/plugins/testdata/testdata_generator.py index 4d9b850..dbadda2 100644 --- a/generator/plugins/testdata/testdata_generator.py +++ b/generator/plugins/testdata/testdata_generator.py @@ -7,14 +7,14 @@ import logging import re from copy import deepcopy -from typing import Any, Dict, List, Optional, Tuple, Union +from typing import Any, List, Optional import generator.model as model LSP_MAX_INT = 2**31 - 1 LSP_MIN_INT = -(2**31) -LSP_MAX_UINT = 2**31 - 1 +LSP_MAX_UINT = 2**32 - 1 LSP_MIN_UINT = 0 LSP_OVER_MAX_INT = LSP_MAX_INT + 1 diff --git a/generator/plugins/testdata/testdata_utils.py b/generator/plugins/testdata/testdata_utils.py index 879ce2f..67797a6 100644 --- a/generator/plugins/testdata/testdata_utils.py +++ b/generator/plugins/testdata/testdata_utils.py @@ -12,13 +12,14 @@ logger = logging.getLogger("testdata") -def generate_from_spec(spec: model.LSPModel, output_dir: str) -> None: +def generate_from_spec(spec: model.LSPModel, output_dir: str, test_dir: str) -> None: """Generate the code for the given spec.""" output = pathlib.Path(output_dir) if not output.exists(): output.mkdir(parents=True, exist_ok=True) + logger.info("Cleaning up existing data") cleanup(output) # key is the relative path to the file, value is the content code: Dict[str, str] = generate(spec, logger) diff --git a/noxfile.py b/noxfile.py index 88cf122..c9ce745 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,7 +20,7 @@ def _install_requirements(session: nox.Session): @nox.session() def tests(session: nox.Session): - """Run tests for generator and generated code in all languages.""" + """Run tests for generator and generated code in python.""" _install_requirements(session) session.log("Running test data generator.") @@ -205,14 +205,14 @@ def create_plugin(session: nox.Session): package_root = pathlib.Path(__file__).parent / "packages" / name / "lsprotocol" package_root.mkdir(parents=True, exist_ok=True) package_root.joinpath("README.md").write_text( - f"# your generated code and other package files go under this directory.", + "# your generated code and other package files go under this directory.", encoding="utf-8", ) tests_root = pathlib.Path(__file__).parent / "tests" / name tests_root.mkdir(parents=True, exist_ok=True) tests_root.joinpath("README.md").write_text( - f"# your tests go under this directory.", encoding="utf-8" + "# your tests go under this directory.", encoding="utf-8" ) launch_json_path = pathlib.Path(__file__).parent / ".vscode" / "launch.json" @@ -253,5 +253,9 @@ def generate_rust(session: nox.Session): _install_requirements(session) session.run("python", "-m", "generator", "--plugin", "rust") + with session.chdir("./packages/rust/lsprotocol"): session.run("cargo", "fmt", external=True) + with session.chdir("./tests/rust"): + session.run("cargo", "fmt", external=True) + session.run("cargo", "build", external=True) diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index 377c5be..231c462 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -334,12 +334,12 @@ pub enum LSPNotificationMethods { #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] pub enum MessageDirection { - #[serde(rename = "both")] - Both, - #[serde(rename = "serverToClient")] - ServerToClient, #[serde(rename = "clientToServer")] ClientToServer, + #[serde(rename = "serverToClient")] + ServerToClient, + #[serde(rename = "both")] + Both, } /// A set of predefined token types. This set is not fixed @@ -477,7 +477,7 @@ pub enum DocumentDiagnosticReportKind { } /// Predefined error codes. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum ErrorCodes { ParseError = -32700, @@ -495,8 +495,42 @@ pub enum ErrorCodes { UnknownErrorCode = -32001, } - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +impl Serialize for ErrorCodes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + ErrorCodes::ParseError => serializer.serialize_i32(-32700), + ErrorCodes::InvalidRequest => serializer.serialize_i32(-32600), + ErrorCodes::MethodNotFound => serializer.serialize_i32(-32601), + ErrorCodes::InvalidParams => serializer.serialize_i32(-32602), + ErrorCodes::InternalError => serializer.serialize_i32(-32603), + ErrorCodes::ServerNotInitialized => serializer.serialize_i32(-32002), + ErrorCodes::UnknownErrorCode => serializer.serialize_i32(-32001), + } + } +} +impl<'de> Deserialize<'de> for ErrorCodes { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + -32700 => Ok(ErrorCodes::ParseError), + -32600 => Ok(ErrorCodes::InvalidRequest), + -32601 => Ok(ErrorCodes::MethodNotFound), + -32602 => Ok(ErrorCodes::InvalidParams), + -32603 => Ok(ErrorCodes::InternalError), + -32002 => Ok(ErrorCodes::ServerNotInitialized), + -32001 => Ok(ErrorCodes::UnknownErrorCode), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} + +#[derive(PartialEq, Debug, Eq, Clone)] pub enum LSPErrorCodes { /// A request failed but it was syntactically correct, e.g the /// method name was known and the parameters were valid. The error @@ -527,6 +561,34 @@ pub enum LSPErrorCodes { /// the cancel. RequestCancelled = -32800, } +impl Serialize for LSPErrorCodes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + LSPErrorCodes::RequestFailed => serializer.serialize_i32(-32803), + LSPErrorCodes::ServerCancelled => serializer.serialize_i32(-32802), + LSPErrorCodes::ContentModified => serializer.serialize_i32(-32801), + LSPErrorCodes::RequestCancelled => serializer.serialize_i32(-32800), + } + } +} +impl<'de> Deserialize<'de> for LSPErrorCodes { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + -32803 => Ok(LSPErrorCodes::RequestFailed), + -32802 => Ok(LSPErrorCodes::ServerCancelled), + -32801 => Ok(LSPErrorCodes::ContentModified), + -32800 => Ok(LSPErrorCodes::RequestCancelled), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// A set of predefined range kinds. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -545,7 +607,7 @@ pub enum FoldingRangeKind { } /// A symbol kind. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum SymbolKind { File = 1, @@ -599,15 +661,109 @@ pub enum SymbolKind { TypeParameter = 26, } +impl Serialize for SymbolKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + SymbolKind::File => serializer.serialize_i32(1), + SymbolKind::Module => serializer.serialize_i32(2), + SymbolKind::Namespace => serializer.serialize_i32(3), + SymbolKind::Package => serializer.serialize_i32(4), + SymbolKind::Class => serializer.serialize_i32(5), + SymbolKind::Method => serializer.serialize_i32(6), + SymbolKind::Property => serializer.serialize_i32(7), + SymbolKind::Field => serializer.serialize_i32(8), + SymbolKind::Constructor => serializer.serialize_i32(9), + SymbolKind::Enum => serializer.serialize_i32(10), + SymbolKind::Interface => serializer.serialize_i32(11), + SymbolKind::Function => serializer.serialize_i32(12), + SymbolKind::Variable => serializer.serialize_i32(13), + SymbolKind::Constant => serializer.serialize_i32(14), + SymbolKind::String => serializer.serialize_i32(15), + SymbolKind::Number => serializer.serialize_i32(16), + SymbolKind::Boolean => serializer.serialize_i32(17), + SymbolKind::Array => serializer.serialize_i32(18), + SymbolKind::Object => serializer.serialize_i32(19), + SymbolKind::Key => serializer.serialize_i32(20), + SymbolKind::Null => serializer.serialize_i32(21), + SymbolKind::EnumMember => serializer.serialize_i32(22), + SymbolKind::Struct => serializer.serialize_i32(23), + SymbolKind::Event => serializer.serialize_i32(24), + SymbolKind::Operator => serializer.serialize_i32(25), + SymbolKind::TypeParameter => serializer.serialize_i32(26), + } + } +} +impl<'de> Deserialize<'de> for SymbolKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(SymbolKind::File), + 2 => Ok(SymbolKind::Module), + 3 => Ok(SymbolKind::Namespace), + 4 => Ok(SymbolKind::Package), + 5 => Ok(SymbolKind::Class), + 6 => Ok(SymbolKind::Method), + 7 => Ok(SymbolKind::Property), + 8 => Ok(SymbolKind::Field), + 9 => Ok(SymbolKind::Constructor), + 10 => Ok(SymbolKind::Enum), + 11 => Ok(SymbolKind::Interface), + 12 => Ok(SymbolKind::Function), + 13 => Ok(SymbolKind::Variable), + 14 => Ok(SymbolKind::Constant), + 15 => Ok(SymbolKind::String), + 16 => Ok(SymbolKind::Number), + 17 => Ok(SymbolKind::Boolean), + 18 => Ok(SymbolKind::Array), + 19 => Ok(SymbolKind::Object), + 20 => Ok(SymbolKind::Key), + 21 => Ok(SymbolKind::Null), + 22 => Ok(SymbolKind::EnumMember), + 23 => Ok(SymbolKind::Struct), + 24 => Ok(SymbolKind::Event), + 25 => Ok(SymbolKind::Operator), + 26 => Ok(SymbolKind::TypeParameter), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// Symbol tags are extra annotations that tweak the rendering of a symbol. /// /// @since 3.16 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum SymbolTag { /// Render a symbol as obsolete, usually using a strike-out. Deprecated = 1, } +impl Serialize for SymbolTag { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + SymbolTag::Deprecated => serializer.serialize_i32(1), + } + } +} +impl<'de> Deserialize<'de> for SymbolTag { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(SymbolTag::Deprecated), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// Moniker uniqueness level to define scope of the moniker. /// @@ -657,7 +813,7 @@ pub enum MonikerKind { /// Inlay hint kinds. /// /// @since 3.17.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum InlayHintKind { /// An inlay hint that for a type annotation. Type = 1, @@ -665,9 +821,33 @@ pub enum InlayHintKind { /// An inlay hint that is for a parameter. Parameter = 2, } +impl Serialize for InlayHintKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + InlayHintKind::Type => serializer.serialize_i32(1), + InlayHintKind::Parameter => serializer.serialize_i32(2), + } + } +} +impl<'de> Deserialize<'de> for InlayHintKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(InlayHintKind::Type), + 2 => Ok(InlayHintKind::Parameter), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// The message type -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum MessageType { /// An error message. Error = 1, @@ -686,10 +866,40 @@ pub enum MessageType { /// @since 3.18.0 Debug = 5, } +impl Serialize for MessageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + MessageType::Error => serializer.serialize_i32(1), + MessageType::Warning => serializer.serialize_i32(2), + MessageType::Info => serializer.serialize_i32(3), + MessageType::Log => serializer.serialize_i32(4), + MessageType::Debug => serializer.serialize_i32(5), + } + } +} +impl<'de> Deserialize<'de> for MessageType { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(MessageType::Error), + 2 => Ok(MessageType::Warning), + 3 => Ok(MessageType::Info), + 4 => Ok(MessageType::Log), + 5 => Ok(MessageType::Debug), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// Defines how the host (editor) should sync /// document changes to the language server. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum TextDocumentSyncKind { /// Documents should not be synced at all. None = 0, @@ -703,9 +913,35 @@ pub enum TextDocumentSyncKind { /// send. Incremental = 2, } +impl Serialize for TextDocumentSyncKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + TextDocumentSyncKind::None => serializer.serialize_i32(0), + TextDocumentSyncKind::Full => serializer.serialize_i32(1), + TextDocumentSyncKind::Incremental => serializer.serialize_i32(2), + } + } +} +impl<'de> Deserialize<'de> for TextDocumentSyncKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 0 => Ok(TextDocumentSyncKind::None), + 1 => Ok(TextDocumentSyncKind::Full), + 2 => Ok(TextDocumentSyncKind::Incremental), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// Represents reasons why a text document is saved. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum TextDocumentSaveReason { /// Manually triggered, e.g. by the user pressing save, by starting debugging, /// or by an API call. @@ -717,9 +953,35 @@ pub enum TextDocumentSaveReason { /// When the editor lost focus. FocusOut = 3, } +impl Serialize for TextDocumentSaveReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + TextDocumentSaveReason::Manual => serializer.serialize_i32(1), + TextDocumentSaveReason::AfterDelay => serializer.serialize_i32(2), + TextDocumentSaveReason::FocusOut => serializer.serialize_i32(3), + } + } +} +impl<'de> Deserialize<'de> for TextDocumentSaveReason { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(TextDocumentSaveReason::Manual), + 2 => Ok(TextDocumentSaveReason::AfterDelay), + 3 => Ok(TextDocumentSaveReason::FocusOut), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// The kind of a completion entry. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum CompletionItemKind { Text = 1, @@ -771,20 +1033,112 @@ pub enum CompletionItemKind { TypeParameter = 25, } +impl Serialize for CompletionItemKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + CompletionItemKind::Text => serializer.serialize_i32(1), + CompletionItemKind::Method => serializer.serialize_i32(2), + CompletionItemKind::Function => serializer.serialize_i32(3), + CompletionItemKind::Constructor => serializer.serialize_i32(4), + CompletionItemKind::Field => serializer.serialize_i32(5), + CompletionItemKind::Variable => serializer.serialize_i32(6), + CompletionItemKind::Class => serializer.serialize_i32(7), + CompletionItemKind::Interface => serializer.serialize_i32(8), + CompletionItemKind::Module => serializer.serialize_i32(9), + CompletionItemKind::Property => serializer.serialize_i32(10), + CompletionItemKind::Unit => serializer.serialize_i32(11), + CompletionItemKind::Value => serializer.serialize_i32(12), + CompletionItemKind::Enum => serializer.serialize_i32(13), + CompletionItemKind::Keyword => serializer.serialize_i32(14), + CompletionItemKind::Snippet => serializer.serialize_i32(15), + CompletionItemKind::Color => serializer.serialize_i32(16), + CompletionItemKind::File => serializer.serialize_i32(17), + CompletionItemKind::Reference => serializer.serialize_i32(18), + CompletionItemKind::Folder => serializer.serialize_i32(19), + CompletionItemKind::EnumMember => serializer.serialize_i32(20), + CompletionItemKind::Constant => serializer.serialize_i32(21), + CompletionItemKind::Struct => serializer.serialize_i32(22), + CompletionItemKind::Event => serializer.serialize_i32(23), + CompletionItemKind::Operator => serializer.serialize_i32(24), + CompletionItemKind::TypeParameter => serializer.serialize_i32(25), + } + } +} +impl<'de> Deserialize<'de> for CompletionItemKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(CompletionItemKind::Text), + 2 => Ok(CompletionItemKind::Method), + 3 => Ok(CompletionItemKind::Function), + 4 => Ok(CompletionItemKind::Constructor), + 5 => Ok(CompletionItemKind::Field), + 6 => Ok(CompletionItemKind::Variable), + 7 => Ok(CompletionItemKind::Class), + 8 => Ok(CompletionItemKind::Interface), + 9 => Ok(CompletionItemKind::Module), + 10 => Ok(CompletionItemKind::Property), + 11 => Ok(CompletionItemKind::Unit), + 12 => Ok(CompletionItemKind::Value), + 13 => Ok(CompletionItemKind::Enum), + 14 => Ok(CompletionItemKind::Keyword), + 15 => Ok(CompletionItemKind::Snippet), + 16 => Ok(CompletionItemKind::Color), + 17 => Ok(CompletionItemKind::File), + 18 => Ok(CompletionItemKind::Reference), + 19 => Ok(CompletionItemKind::Folder), + 20 => Ok(CompletionItemKind::EnumMember), + 21 => Ok(CompletionItemKind::Constant), + 22 => Ok(CompletionItemKind::Struct), + 23 => Ok(CompletionItemKind::Event), + 24 => Ok(CompletionItemKind::Operator), + 25 => Ok(CompletionItemKind::TypeParameter), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// Completion item tags are extra annotations that tweak the rendering of a completion /// item. /// /// @since 3.15.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum CompletionItemTag { /// Render a completion as obsolete, usually using a strike-out. Deprecated = 1, } +impl Serialize for CompletionItemTag { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + CompletionItemTag::Deprecated => serializer.serialize_i32(1), + } + } +} +impl<'de> Deserialize<'de> for CompletionItemTag { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(CompletionItemTag::Deprecated), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// Defines whether the insert text in a completion item should be interpreted as /// plain text or a snippet. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum InsertTextFormat { /// The primary text to be inserted is treated as a plain string. PlainText = 1, @@ -799,12 +1153,36 @@ pub enum InsertTextFormat { /// See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax Snippet = 2, } +impl Serialize for InsertTextFormat { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + InsertTextFormat::PlainText => serializer.serialize_i32(1), + InsertTextFormat::Snippet => serializer.serialize_i32(2), + } + } +} +impl<'de> Deserialize<'de> for InsertTextFormat { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(InsertTextFormat::PlainText), + 2 => Ok(InsertTextFormat::Snippet), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// How whitespace and indentation is handled during completion /// item insertion. /// /// @since 3.16.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum InsertTextMode { /// The insertion or replace strings is taken as it is. If the /// value is multi line the lines below the cursor will be @@ -822,9 +1200,33 @@ pub enum InsertTextMode { /// following lines inserted will be indented using 2 tabs as well. AdjustIndentation = 2, } +impl Serialize for InsertTextMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + InsertTextMode::AsIs => serializer.serialize_i32(1), + InsertTextMode::AdjustIndentation => serializer.serialize_i32(2), + } + } +} +impl<'de> Deserialize<'de> for InsertTextMode { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(InsertTextMode::AsIs), + 2 => Ok(InsertTextMode::AdjustIndentation), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// A document highlight kind. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum DocumentHighlightKind { /// A textual occurrence. Text = 1, @@ -835,6 +1237,32 @@ pub enum DocumentHighlightKind { /// Write-access of a symbol, like writing to a variable. Write = 3, } +impl Serialize for DocumentHighlightKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + DocumentHighlightKind::Text => serializer.serialize_i32(1), + DocumentHighlightKind::Read => serializer.serialize_i32(2), + DocumentHighlightKind::Write => serializer.serialize_i32(3), + } + } +} +impl<'de> Deserialize<'de> for DocumentHighlightKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(DocumentHighlightKind::Text), + 2 => Ok(DocumentHighlightKind::Read), + 3 => Ok(DocumentHighlightKind::Write), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// A set of predefined code action kinds #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -943,7 +1371,7 @@ pub enum MarkupKind { /// @since 3.18.0 /// @proposed #[cfg(feature = "proposed")] -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum InlineCompletionTriggerKind { /// Completion was triggered explicitly by a user gesture. Invoked = 0, @@ -951,6 +1379,30 @@ pub enum InlineCompletionTriggerKind { /// Completion was triggered automatically while editing. Automatic = 1, } +impl Serialize for InlineCompletionTriggerKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + InlineCompletionTriggerKind::Invoked => serializer.serialize_i32(0), + InlineCompletionTriggerKind::Automatic => serializer.serialize_i32(1), + } + } +} +impl<'de> Deserialize<'de> for InlineCompletionTriggerKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 0 => Ok(InlineCompletionTriggerKind::Invoked), + 1 => Ok(InlineCompletionTriggerKind::Automatic), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// A set of predefined position encoding kinds. /// @@ -978,7 +1430,7 @@ pub enum PositionEncodingKind { } /// The file event type -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum FileChangeType { /// The file got created. Created = 1, @@ -989,8 +1441,34 @@ pub enum FileChangeType { /// The file got deleted. Deleted = 3, } - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +impl Serialize for FileChangeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + FileChangeType::Created => serializer.serialize_i32(1), + FileChangeType::Changed => serializer.serialize_i32(2), + FileChangeType::Deleted => serializer.serialize_i32(3), + } + } +} +impl<'de> Deserialize<'de> for FileChangeType { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(FileChangeType::Created), + 2 => Ok(FileChangeType::Changed), + 3 => Ok(FileChangeType::Deleted), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} + +#[derive(PartialEq, Debug, Eq, Clone)] pub enum WatchKind { /// Interested in create events. Create = 1, @@ -1001,9 +1479,35 @@ pub enum WatchKind { /// Interested in delete events Delete = 4, } +impl Serialize for WatchKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + WatchKind::Create => serializer.serialize_i32(1), + WatchKind::Change => serializer.serialize_i32(2), + WatchKind::Delete => serializer.serialize_i32(4), + } + } +} +impl<'de> Deserialize<'de> for WatchKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(WatchKind::Create), + 2 => Ok(WatchKind::Change), + 4 => Ok(WatchKind::Delete), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// The diagnostic's severity. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum DiagnosticSeverity { /// Reports an error. Error = 1, @@ -1017,11 +1521,39 @@ pub enum DiagnosticSeverity { /// Reports a hint. Hint = 4, } +impl Serialize for DiagnosticSeverity { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + DiagnosticSeverity::Error => serializer.serialize_i32(1), + DiagnosticSeverity::Warning => serializer.serialize_i32(2), + DiagnosticSeverity::Information => serializer.serialize_i32(3), + DiagnosticSeverity::Hint => serializer.serialize_i32(4), + } + } +} +impl<'de> Deserialize<'de> for DiagnosticSeverity { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(DiagnosticSeverity::Error), + 2 => Ok(DiagnosticSeverity::Warning), + 3 => Ok(DiagnosticSeverity::Information), + 4 => Ok(DiagnosticSeverity::Hint), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// The diagnostic tags. /// /// @since 3.15.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum DiagnosticTag { /// Unused or unnecessary code. /// @@ -1034,9 +1566,33 @@ pub enum DiagnosticTag { /// Clients are allowed to rendered diagnostics with this tag strike through. Deprecated = 2, } +impl Serialize for DiagnosticTag { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + DiagnosticTag::Unnecessary => serializer.serialize_i32(1), + DiagnosticTag::Deprecated => serializer.serialize_i32(2), + } + } +} +impl<'de> Deserialize<'de> for DiagnosticTag { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(DiagnosticTag::Unnecessary), + 2 => Ok(DiagnosticTag::Deprecated), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// How a completion was triggered -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum CompletionTriggerKind { /// Completion was triggered by typing an identifier (24x7 code /// complete), manual invocation (e.g Ctrl+Space) or via API. @@ -1049,11 +1605,37 @@ pub enum CompletionTriggerKind { /// Completion was re-triggered as current completion list is incomplete TriggerForIncompleteCompletions = 3, } +impl Serialize for CompletionTriggerKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + CompletionTriggerKind::Invoked => serializer.serialize_i32(1), + CompletionTriggerKind::TriggerCharacter => serializer.serialize_i32(2), + CompletionTriggerKind::TriggerForIncompleteCompletions => serializer.serialize_i32(3), + } + } +} +impl<'de> Deserialize<'de> for CompletionTriggerKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(CompletionTriggerKind::Invoked), + 2 => Ok(CompletionTriggerKind::TriggerCharacter), + 3 => Ok(CompletionTriggerKind::TriggerForIncompleteCompletions), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// How a signature help was triggered. /// /// @since 3.15.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum SignatureHelpTriggerKind { /// Signature help was invoked manually by the user or by a command. Invoked = 1, @@ -1064,11 +1646,37 @@ pub enum SignatureHelpTriggerKind { /// Signature help was triggered by the cursor moving or by the document content changing. ContentChange = 3, } +impl Serialize for SignatureHelpTriggerKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + SignatureHelpTriggerKind::Invoked => serializer.serialize_i32(1), + SignatureHelpTriggerKind::TriggerCharacter => serializer.serialize_i32(2), + SignatureHelpTriggerKind::ContentChange => serializer.serialize_i32(3), + } + } +} +impl<'de> Deserialize<'de> for SignatureHelpTriggerKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(SignatureHelpTriggerKind::Invoked), + 2 => Ok(SignatureHelpTriggerKind::TriggerCharacter), + 3 => Ok(SignatureHelpTriggerKind::ContentChange), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// The reason why code actions were requested. /// /// @since 3.17.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum CodeActionTriggerKind { /// Code actions were explicitly requested by the user or by an extension. Invoked = 1, @@ -1079,6 +1687,30 @@ pub enum CodeActionTriggerKind { /// also be triggered when file content changes. Automatic = 2, } +impl Serialize for CodeActionTriggerKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + CodeActionTriggerKind::Invoked => serializer.serialize_i32(1), + CodeActionTriggerKind::Automatic => serializer.serialize_i32(2), + } + } +} +impl<'de> Deserialize<'de> for CodeActionTriggerKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(CodeActionTriggerKind::Invoked), + 2 => Ok(CodeActionTriggerKind::Automatic), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} /// A pattern kind describing if a glob pattern matches a file a folder or /// both. @@ -1098,7 +1730,7 @@ pub enum FileOperationPatternKind { /// A notebook cell kind. /// /// @since 3.17.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum NotebookCellKind { /// A markup-cell is formatted source that is used for display. Markup = 1, @@ -1106,6 +1738,30 @@ pub enum NotebookCellKind { /// A code-cell is source code. Code = 2, } +impl Serialize for NotebookCellKind { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + NotebookCellKind::Markup => serializer.serialize_i32(1), + NotebookCellKind::Code => serializer.serialize_i32(2), + } + } +} +impl<'de> Deserialize<'de> for NotebookCellKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(NotebookCellKind::Markup), + 2 => Ok(NotebookCellKind::Code), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] pub enum ResourceOperationKind { @@ -1146,12 +1802,34 @@ pub enum FailureHandlingKind { Undo, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[derive(PartialEq, Debug, Eq, Clone)] pub enum PrepareSupportDefaultBehavior { /// The client's default behavior is to select the identifier /// according the to language's syntax rule. Identifier = 1, } +impl Serialize for PrepareSupportDefaultBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + PrepareSupportDefaultBehavior::Identifier => serializer.serialize_i32(1), + } + } +} +impl<'de> Deserialize<'de> for PrepareSupportDefaultBehavior { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + match value { + 1 => Ok(PrepareSupportDefaultBehavior::Identifier), + _ => Err(serde::de::Error::custom("Unexpected value")), + } + } +} #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] pub enum TokenFormat { diff --git a/tests/rust/src/main.rs b/tests/rust/src/main.rs index c54ae5e..4c24b25 100644 --- a/tests/rust/src/main.rs +++ b/tests/rust/src/main.rs @@ -6,7 +6,6 @@ mod tests { use glob::glob; use lsprotocol::*; use serde::Deserialize; - use serde_json::Value; use std::fs; fn get_all_json_files(root: &str) -> Vec { @@ -33,10 +32,301 @@ mod tests { fn validate(lsp_type: &str, result_type: &str, data: &str) { match lsp_type { + // Start of generated code + + // Sample Generated Code: + // "CallHierarchyIncomingCallsRequest" => { + // return validate_type::(result_type, data) + // } + "TextDocumentImplementationRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentTypeDefinitionRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceWorkspaceFoldersRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceConfigurationRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentDocumentColorRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentColorPresentationRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentFoldingRangeRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceFoldingRangeRefreshRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentDeclarationRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentSelectionRangeRequest" => { + return validate_type::(result_type, data) + } + "WindowWorkDoneProgressCreateRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentPrepareCallHierarchyRequest" => { + return validate_type::(result_type, data) + } "CallHierarchyIncomingCallsRequest" => { return validate_type::(result_type, data) } - + "CallHierarchyOutgoingCallsRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentSemanticTokensFullRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentSemanticTokensFullDeltaRequest" => { + return validate_type::( + result_type, + data, + ) + } + "TextDocumentSemanticTokensRangeRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceSemanticTokensRefreshRequest" => { + return validate_type::(result_type, data) + } + "WindowShowDocumentRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentLinkedEditingRangeRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceWillCreateFilesRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceWillRenameFilesRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceWillDeleteFilesRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentMonikerRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentPrepareTypeHierarchyRequest" => { + return validate_type::(result_type, data) + } + "TypeHierarchySupertypesRequest" => { + return validate_type::(result_type, data) + } + "TypeHierarchySubtypesRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentInlineValueRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceInlineValueRefreshRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentInlayHintRequest" => { + return validate_type::(result_type, data) + } + "InlayHintResolveRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceInlayHintRefreshRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentDiagnosticRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceDiagnosticRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceDiagnosticRefreshRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentInlineCompletionRequest" => { + return validate_type::(result_type, data) + } + "ClientRegisterCapabilityRequest" => { + return validate_type::(result_type, data) + } + "ClientUnregisterCapabilityRequest" => { + return validate_type::(result_type, data) + } + "InitializeRequest" => return validate_type::(result_type, data), + "ShutdownRequest" => return validate_type::(result_type, data), + "WindowShowMessageRequestRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentWillSaveWaitUntilRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentCompletionRequest" => { + return validate_type::(result_type, data) + } + "CompletionItemResolveRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentHoverRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentSignatureHelpRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentDefinitionRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentReferencesRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentDocumentHighlightRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentDocumentSymbolRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentCodeActionRequest" => { + return validate_type::(result_type, data) + } + "CodeActionResolveRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceSymbolRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceSymbolResolveRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentCodeLensRequest" => { + return validate_type::(result_type, data) + } + "CodeLensResolveRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceCodeLensRefreshRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentDocumentLinkRequest" => { + return validate_type::(result_type, data) + } + "DocumentLinkResolveRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentFormattingRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentRangeFormattingRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentRangesFormattingRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentOnTypeFormattingRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentRenameRequest" => { + return validate_type::(result_type, data) + } + "TextDocumentPrepareRenameRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceExecuteCommandRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceApplyEditRequest" => { + return validate_type::(result_type, data) + } + "WorkspaceDidChangeWorkspaceFoldersNotification" => { + return validate_type::( + result_type, + data, + ) + } + "WindowWorkDoneProgressCancelNotification" => { + return validate_type::(result_type, data) + } + "WorkspaceDidCreateFilesNotification" => { + return validate_type::(result_type, data) + } + "WorkspaceDidRenameFilesNotification" => { + return validate_type::(result_type, data) + } + "WorkspaceDidDeleteFilesNotification" => { + return validate_type::(result_type, data) + } + "NotebookDocumentDidOpenNotification" => { + return validate_type::(result_type, data) + } + "NotebookDocumentDidChangeNotification" => { + return validate_type::(result_type, data) + } + "NotebookDocumentDidSaveNotification" => { + return validate_type::(result_type, data) + } + "NotebookDocumentDidCloseNotification" => { + return validate_type::(result_type, data) + } + "InitializedNotification" => { + return validate_type::(result_type, data) + } + "ExitNotification" => return validate_type::(result_type, data), + "WorkspaceDidChangeConfigurationNotification" => { + return validate_type::( + result_type, + data, + ) + } + "WindowShowMessageNotification" => { + return validate_type::(result_type, data) + } + "WindowLogMessageNotification" => { + return validate_type::(result_type, data) + } + "TelemetryEventNotification" => { + return validate_type::(result_type, data) + } + "TextDocumentDidOpenNotification" => { + return validate_type::(result_type, data) + } + "TextDocumentDidChangeNotification" => { + return validate_type::(result_type, data) + } + "TextDocumentDidCloseNotification" => { + return validate_type::(result_type, data) + } + "TextDocumentDidSaveNotification" => { + return validate_type::(result_type, data) + } + "TextDocumentWillSaveNotification" => { + return validate_type::(result_type, data) + } + "WorkspaceDidChangeWatchedFilesNotification" => { + return validate_type::( + result_type, + data, + ) + } + "TextDocumentPublishDiagnosticsNotification" => { + return validate_type::( + result_type, + data, + ) + } + "SetTraceNotification" => { + return validate_type::(result_type, data) + } + "LogTraceNotification" => { + return validate_type::(result_type, data) + } + "CancelRequestNotification" => { + return validate_type::(result_type, data) + } + "ProgressNotification" => { + return validate_type::(result_type, data) + } + // End of generated code _ => (), } } @@ -48,8 +338,8 @@ mod tests { let cwd = std::env::current_dir() .unwrap() .join("../../packages/testdata"); - let env_value = - std::env::var("TEST_DATA_ROOT").unwrap_or_else(|_| cwd.to_str().unwrap().to_string()); + let env_value = std::env::var("LSP_TEST_DATA_PATH") + .unwrap_or_else(|_| cwd.to_str().unwrap().to_string()); println!("TEST_DATA_ROOT: {}", env_value); for json_file in get_all_json_files(env_value.as_str()) { let basename = std::path::Path::new(&json_file) @@ -68,24 +358,4 @@ mod tests { } } -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -enum MyEnum { - Something = 1, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -struct MyStruct { - pub kind: MyEnum, -} - -fn main() { - let json_str = "{\"kind\": 1}"; - let _result: MyStruct = serde_json::from_str(json_str).unwrap(); -} - -// let file_path: String = "".to_string(); -// let data = &fs::read_to_string(file_path.clone()).unwrap(); -// let result: CallHierarchyIncomingCallsRequest = serde_json::from_str(data).unwrap(); +fn main() {} From e38d2fe30869b799a5f3559b9ec98408df4f0fb5 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 11:09:35 -0800 Subject: [PATCH 05/27] Fix numeric ranges --- generator/plugins/testdata/testdata_generator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generator/plugins/testdata/testdata_generator.py b/generator/plugins/testdata/testdata_generator.py index dbadda2..6b90784 100644 --- a/generator/plugins/testdata/testdata_generator.py +++ b/generator/plugins/testdata/testdata_generator.py @@ -14,14 +14,14 @@ LSP_MAX_INT = 2**31 - 1 LSP_MIN_INT = -(2**31) -LSP_MAX_UINT = 2**32 - 1 +LSP_MAX_UINT = 2**31 - 1 LSP_MIN_UINT = 0 -LSP_OVER_MAX_INT = LSP_MAX_INT + 1 -LSP_UNDER_MIN_INT = LSP_MIN_INT - 1 +LSP_OVER_MAX_INT = 2**31 +LSP_UNDER_MIN_INT = -(2**31) - 1 -LSP_OVER_MAX_UINT = LSP_MAX_UINT + 1 -LSP_UNDER_MIN_UINT = LSP_MIN_UINT - 1 +LSP_OVER_MAX_UINT = 2**32 + 1 +LSP_UNDER_MIN_UINT = -1 def get_hash_from(text: str) -> str: From f6db5eb2c05e01ff7236584b10c32d6b811eac37 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 6 Nov 2023 12:18:06 -0800 Subject: [PATCH 06/27] Update packages to python min 3.8 --- .github/workflows/pr-check.yml | 8 +- .github/workflows/push-check.yml | 6 +- README.md | 6 +- azure-pipelines/release-pypi.yml | 2 +- azure-pipelines/template/build_packages.yml | 8 +- azure-pipelines/template/publish_pypi.yml | 8 +- generator/plugins/python/utils.py | 3 +- packages/python/pyproject.toml | 5 +- packages/python/requirements.txt | 22 +- requirements.txt | 213 +++++++++++++------- runtime.txt | 2 +- 11 files changed, 172 insertions(+), 111 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index ae7fe19..312a6a3 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -11,10 +11,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Use Python 3.7 + - name: Use Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Pip cache uses: actions/cache@v3 @@ -96,7 +96,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout @@ -225,7 +225,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout diff --git a/.github/workflows/push-check.yml b/.github/workflows/push-check.yml index 6107a00..2062610 100644 --- a/.github/workflows/push-check.yml +++ b/.github/workflows/push-check.yml @@ -16,10 +16,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Use Python 3.7 + - name: Use Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Pip cache uses: actions/cache@v3 @@ -101,7 +101,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout diff --git a/README.md b/README.md index 5bcdce0..7be6ff8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This repository contains code to generate Language Server Protocol types and cla You will need a python environment to run the generator. Here are the steps: -1. Create a python environment (min supported python 3.7): `python -m venv .venv` +1. Create a python environment (min supported python 3.8): `python -m venv .venv` 2. Get this tool: `python -m pip install git+https://github.com/microsoft/lsprotocol.git` 3. Run your plugin: `python -m generator --plugin dotnet --output-dir ./code` @@ -52,10 +52,10 @@ You can format code, run tests, and other tasks using `nox` as well. Follow these steps to generate boiler plate code for new plugin: -1. Create a virtual environment for python using python 3.7 and activate that environment. +1. Create a virtual environment for python using python 3.8 and activate that environment. 1. If you have python extension for VS Code installed then run `Python: Create Environment` command. Be sure to select all the `requirements.txt` files in the repo. This should, install all packages needed and select the environment for you. 1. Ensure `nox` is installed. - 1. Run `nox --list`, is nox is installed oyu should see a list of available sessions. Otherwise, run `python -m pip install nox` from the python 3.7 environment you created above. + 1. Run `nox --list`, is nox is installed oyu should see a list of available sessions. Otherwise, run `python -m pip install nox` from the python 3.8 environment you created above. 1. Run `nox --session create_plugin` and follow the prompts to create a new plugin. Example: diff --git a/azure-pipelines/release-pypi.yml b/azure-pipelines/release-pypi.yml index 37df592..4b86065 100644 --- a/azure-pipelines/release-pypi.yml +++ b/azure-pipelines/release-pypi.yml @@ -19,7 +19,7 @@ extends: template: azure-pipelines/pypi-package/pipeline.yml@templates parameters: publishPackage: ${{ parameters.publishPackage }} - pythonVersion: '3.7' + pythonVersion: '3.8' # We don't ship any built in packages. generateNotice: false pyProjectTomlPath: $(Build.SourcesDirectory)/packages/python/pyproject.toml diff --git a/azure-pipelines/template/build_packages.yml b/azure-pipelines/template/build_packages.yml index ca99144..9f62cfd 100644 --- a/azure-pipelines/template/build_packages.yml +++ b/azure-pipelines/template/build_packages.yml @@ -7,9 +7,9 @@ jobs: steps: - task: UsePythonVersion@0 - displayName: "Use Python 3.7" + displayName: 'Use Python 3.8' inputs: - versionSpec: 3.7 + versionSpec: 3.8 - script: python -m pip install -U pip displayName: Upgrade Pip @@ -25,7 +25,7 @@ jobs: displayName: Build sdist and wheels - task: PublishBuildArtifacts@1 - displayName: "Publish Artifact" + displayName: 'Publish Artifact' inputs: - pathToPublish: "$(Build.SourcesDirectory)/packages/python/dist" + pathToPublish: '$(Build.SourcesDirectory)/packages/python/dist' artifactName: dist diff --git a/azure-pipelines/template/publish_pypi.yml b/azure-pipelines/template/publish_pypi.yml index 1f29e1b..90f3e1d 100644 --- a/azure-pipelines/template/publish_pypi.yml +++ b/azure-pipelines/template/publish_pypi.yml @@ -12,15 +12,15 @@ jobs: steps: - task: DownloadPipelineArtifact@2 - displayName: "Download Pipeline Artifact" + displayName: 'Download Pipeline Artifact' inputs: artifactName: dist - targetPath: "$(Build.SourcesDirectory)/dist" + targetPath: '$(Build.SourcesDirectory)/dist' - task: UsePythonVersion@0 - displayName: "Use Python 3.7" + displayName: 'Use Python 3.8' inputs: - versionSpec: 3.7 + versionSpec: 3.8 - script: python -m pip install -U pip displayName: Upgrade Pip diff --git a/generator/plugins/python/utils.py b/generator/plugins/python/utils.py index 4b7968a..0885057 100644 --- a/generator/plugins/python/utils.py +++ b/generator/plugins/python/utils.py @@ -576,8 +576,7 @@ def _add_type_alias(self, type_alias: model.TypeAlias) -> None: if type_alias.type.kind == "reference" and not self._has_type( type_alias.type.name ): - # TODO: remove workaround for lack of TypeAlias in 3.7 - type_name = f"Union[{type_name}, {type_name}]" + type_name = f"TypeAlias[{type_name}]" if type_name: # clean up the docstring for the class itself. diff --git a/packages/python/pyproject.toml b/packages/python/pyproject.toml index 999d175..dd6bc46 100644 --- a/packages/python/pyproject.toml +++ b/packages/python/pyproject.toml @@ -5,13 +5,13 @@ build-backend = "flit_core.buildapi" [project] name = "lsprotocol" description = 'Python implementation of the Language Server Protocol.' -version = "2023.0.0" +version = "2024.0.0a1" authors = [ { name = "Microsoft Corporation", email = "lsprotocol-help@microsoft.com" }, ] license = { file = "LICENSE" } readme = { "file" = "README.md", "content-type" = "text/markdown" } -requires-python = ">=3.7" +requires-python = ">=3.8" maintainers = [ { name = "Brett Cannon", email = "brett@python.org" }, { name = "Karthik Nadig", email = "kanadig@microsoft.com" }, @@ -20,7 +20,6 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Programming Language :: Python", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/packages/python/requirements.txt b/packages/python/requirements.txt index 1475faa..f9d9405 100644 --- a/packages/python/requirements.txt +++ b/packages/python/requirements.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.7 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --config=pyproject.toml --generate-hashes --resolver=backtracking ./packages/python/requirements.in +# pip-compile --generate-hashes ./packages/python/requirements.in # attrs==23.1.0 \ --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ @@ -18,17 +18,7 @@ exceptiongroup==1.1.3 \ --hash=sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9 \ --hash=sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3 # via cattrs -importlib-metadata==6.7.0 \ - --hash=sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4 \ - --hash=sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5 - # via attrs -typing-extensions==4.7.1 \ - --hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \ - --hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2 - # via - # cattrs - # importlib-metadata -zipp==3.15.0 \ - --hash=sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b \ - --hash=sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556 - # via importlib-metadata +typing-extensions==4.8.0 \ + --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ + --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef + # via cattrs diff --git a/requirements.txt b/requirements.txt index 2a988d3..954f876 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.7 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --generate-hashes --resolver=backtracking ./requirements.in +# pip-compile --generate-hashes ./requirements.in # attrs==23.1.0 \ --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ @@ -11,6 +11,7 @@ attrs==23.1.0 \ # -r ./requirements.in # cattrs # jsonschema + # referencing cattrs==23.1.2 \ --hash=sha256:b2bb14311ac17bed0d58785e5a60f022e5431aca3932e3fc5cc8ed8639de50a4 \ --hash=sha256:db1c821b8c537382b2c7c66678c3790091ca0275ac486c76f3c8f3920e83c657 @@ -25,91 +26,163 @@ exceptiongroup==1.1.3 \ # via # cattrs # pytest -importlib-metadata==6.7.0 \ - --hash=sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4 \ - --hash=sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5 - # via - # attrs - # jsonschema - # pluggy - # pytest -importlib-resources==5.12.0 \ - --hash=sha256:4be82589bf5c1d7999aedf2a45159d10cb3ca4f19b2271f8792bc8e6da7b22f6 \ - --hash=sha256:7b1deeebbf351c7578e09bf2f63fa2ce8b5ffec296e0d349139d43cca061a81a +importlib-resources==6.1.0 \ + --hash=sha256:9d48dcccc213325e810fd723e7fbb45ccb39f6cf5c31f00cf2b965f5f10f3cb9 \ + --hash=sha256:aa50258bbfa56d4e33fbd8aa3ef48ded10d1735f11532b8df95388cc6bdb7e83 # via # -r ./requirements.in # jsonschema + # jsonschema-specifications iniconfig==2.0.0 \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 # via pytest -jsonschema==4.17.3 \ - --hash=sha256:0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d \ - --hash=sha256:a870ad254da1a8ca84b6a2905cac29d265f805acc57af304784962a2aa6508f6 +jsonschema==4.19.2 \ + --hash=sha256:c9ff4d7447eed9592c23a12ccee508baf0dd0d59650615e847feb6cdca74f392 \ + --hash=sha256:eee9e502c788e89cb166d4d37f43084e3b64ab405c795c03d343a4dbc2c810fc # via -r ./requirements.in -packaging==23.1 \ - --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ - --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f +jsonschema-specifications==2023.7.1 \ + --hash=sha256:05adf340b659828a004220a9613be00fa3f223f2b82002e273dee62fd50524b1 \ + --hash=sha256:c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb + # via jsonschema +packaging==23.2 \ + --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ + --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 # via pytest pkgutil-resolve-name==1.3.10 \ --hash=sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174 \ --hash=sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e # via jsonschema -pluggy==1.2.0 \ - --hash=sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849 \ - --hash=sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3 +pluggy==1.3.0 \ + --hash=sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12 \ + --hash=sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7 # via pytest -pyhamcrest==2.0.4 \ - --hash=sha256:60a41d4783b9d56c9ec8586635d2301db5072b3ea8a51c32dd03c408ae2b0f79 \ - --hash=sha256:b5d9ce6b977696286cf232ce2adf8969b4d0b045975b0936ac9005e84e67e9c1 +pyhamcrest==2.1.0 \ + --hash=sha256:c6acbec0923d0cb7e72c22af1926f3e7c97b8e8d69fc7498eabacaf7c975bd9c \ + --hash=sha256:f6913d2f392e30e0375b3ecbd7aee79e5d1faa25d345c8f4ff597665dcac2587 # via -r ./requirements.in -pyrsistent==0.19.3 \ - --hash=sha256:016ad1afadf318eb7911baa24b049909f7f3bb2c5b1ed7b6a8f21db21ea3faa8 \ - --hash=sha256:1a2994773706bbb4995c31a97bc94f1418314923bd1048c6d964837040376440 \ - --hash=sha256:20460ac0ea439a3e79caa1dbd560344b64ed75e85d8703943e0b66c2a6150e4a \ - --hash=sha256:3311cb4237a341aa52ab8448c27e3a9931e2ee09561ad150ba94e4cfd3fc888c \ - --hash=sha256:3a8cb235fa6d3fd7aae6a4f1429bbb1fec1577d978098da1252f0489937786f3 \ - --hash=sha256:3ab2204234c0ecd8b9368dbd6a53e83c3d4f3cab10ecaf6d0e772f456c442393 \ - --hash=sha256:42ac0b2f44607eb92ae88609eda931a4f0dfa03038c44c772e07f43e738bcac9 \ - --hash=sha256:49c32f216c17148695ca0e02a5c521e28a4ee6c5089f97e34fe24163113722da \ - --hash=sha256:4b774f9288dda8d425adb6544e5903f1fb6c273ab3128a355c6b972b7df39dcf \ - --hash=sha256:4c18264cb84b5e68e7085a43723f9e4c1fd1d935ab240ce02c0324a8e01ccb64 \ - --hash=sha256:5a474fb80f5e0d6c9394d8db0fc19e90fa540b82ee52dba7d246a7791712f74a \ - --hash=sha256:64220c429e42a7150f4bfd280f6f4bb2850f95956bde93c6fda1b70507af6ef3 \ - --hash=sha256:878433581fc23e906d947a6814336eee031a00e6defba224234169ae3d3d6a98 \ - --hash=sha256:99abb85579e2165bd8522f0c0138864da97847875ecbd45f3e7e2af569bfc6f2 \ - --hash=sha256:a2471f3f8693101975b1ff85ffd19bb7ca7dd7c38f8a81701f67d6b4f97b87d8 \ - --hash=sha256:aeda827381f5e5d65cced3024126529ddc4289d944f75e090572c77ceb19adbf \ - --hash=sha256:b735e538f74ec31378f5a1e3886a26d2ca6351106b4dfde376a26fc32a044edc \ - --hash=sha256:c147257a92374fde8498491f53ffa8f4822cd70c0d85037e09028e478cababb7 \ - --hash=sha256:c4db1bd596fefd66b296a3d5d943c94f4fac5bcd13e99bffe2ba6a759d959a28 \ - --hash=sha256:c74bed51f9b41c48366a286395c67f4e894374306b197e62810e0fdaf2364da2 \ - --hash=sha256:c9bb60a40a0ab9aba40a59f68214eed5a29c6274c83b2cc206a359c4a89fa41b \ - --hash=sha256:cc5d149f31706762c1f8bda2e8c4f8fead6e80312e3692619a75301d3dbb819a \ - --hash=sha256:ccf0d6bd208f8111179f0c26fdf84ed7c3891982f2edaeae7422575f47e66b64 \ - --hash=sha256:e42296a09e83028b3476f7073fcb69ffebac0e66dbbfd1bd847d61f74db30f19 \ - --hash=sha256:e8f2b814a3dc6225964fa03d8582c6e0b6650d68a232df41e3cc1b66a5d2f8d1 \ - --hash=sha256:f0774bf48631f3a20471dd7c5989657b639fd2d285b861237ea9e82c36a415a9 \ - --hash=sha256:f0e7c4b2f77593871e918be000b96c8107da48444d57005b6a6bc61fb4331b2c - # via jsonschema -pytest==7.4.2 \ - --hash=sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002 \ - --hash=sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069 +pytest==7.4.3 \ + --hash=sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac \ + --hash=sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5 # via -r ./requirements.in +referencing==0.30.2 \ + --hash=sha256:449b6669b6121a9e96a7f9e410b245d471e8d48964c67113ce9afe50c8dd7bdf \ + --hash=sha256:794ad8003c65938edcdbc027f1933215e0d0ccc0291e3ce20a4d87432b59efc0 + # via + # jsonschema + # jsonschema-specifications +rpds-py==0.12.0 \ + --hash=sha256:0525847f83f506aa1e28eb2057b696fe38217e12931c8b1b02198cfe6975e142 \ + --hash=sha256:05942656cb2cb4989cd50ced52df16be94d344eae5097e8583966a1d27da73a5 \ + --hash=sha256:0831d3ecdea22e4559cc1793f22e77067c9d8c451d55ae6a75bf1d116a8e7f42 \ + --hash=sha256:0853da3d5e9bc6a07b2486054a410b7b03f34046c123c6561b535bb48cc509e1 \ + --hash=sha256:08e6e7ff286254016b945e1ab632ee843e43d45e40683b66dd12b73791366dd1 \ + --hash=sha256:0a38612d07a36138507d69646c470aedbfe2b75b43a4643f7bd8e51e52779624 \ + --hash=sha256:0bedd91ae1dd142a4dc15970ed2c729ff6c73f33a40fa84ed0cdbf55de87c777 \ + --hash=sha256:0c5441b7626c29dbd54a3f6f3713ec8e956b009f419ffdaaa3c80eaf98ddb523 \ + --hash=sha256:0e9e976e0dbed4f51c56db10831c9623d0fd67aac02853fe5476262e5a22acb7 \ + --hash=sha256:0fadfdda275c838cba5102c7f90a20f2abd7727bf8f4a2b654a5b617529c5c18 \ + --hash=sha256:1096ca0bf2d3426cbe79d4ccc91dc5aaa73629b08ea2d8467375fad8447ce11a \ + --hash=sha256:171d9a159f1b2f42a42a64a985e4ba46fc7268c78299272ceba970743a67ee50 \ + --hash=sha256:188912b22b6c8225f4c4ffa020a2baa6ad8fabb3c141a12dbe6edbb34e7f1425 \ + --hash=sha256:1b4cf9ab9a0ae0cb122685209806d3f1dcb63b9fccdf1424fb42a129dc8c2faa \ + --hash=sha256:1e04581c6117ad9479b6cfae313e212fe0dfa226ac727755f0d539cd54792963 \ + --hash=sha256:1fa73ed22c40a1bec98d7c93b5659cd35abcfa5a0a95ce876b91adbda170537c \ + --hash=sha256:2124f9e645a94ab7c853bc0a3644e0ca8ffbe5bb2d72db49aef8f9ec1c285733 \ + --hash=sha256:240687b5be0f91fbde4936a329c9b7589d9259742766f74de575e1b2046575e4 \ + --hash=sha256:25740fb56e8bd37692ed380e15ec734be44d7c71974d8993f452b4527814601e \ + --hash=sha256:27ccc93c7457ef890b0dd31564d2a05e1aca330623c942b7e818e9e7c2669ee4 \ + --hash=sha256:281c8b219d4f4b3581b918b816764098d04964915b2f272d1476654143801aa2 \ + --hash=sha256:2d34a5450a402b00d20aeb7632489ffa2556ca7b26f4a63c35f6fccae1977427 \ + --hash=sha256:301bd744a1adaa2f6a5e06c98f1ac2b6f8dc31a5c23b838f862d65e32fca0d4b \ + --hash=sha256:30e5ce9f501fb1f970e4a59098028cf20676dee64fc496d55c33e04bbbee097d \ + --hash=sha256:33ab498f9ac30598b6406e2be1b45fd231195b83d948ebd4bd77f337cb6a2bff \ + --hash=sha256:35585a8cb5917161f42c2104567bb83a1d96194095fc54a543113ed5df9fa436 \ + --hash=sha256:389c0e38358fdc4e38e9995e7291269a3aead7acfcf8942010ee7bc5baee091c \ + --hash=sha256:3acadbab8b59f63b87b518e09c4c64b142e7286b9ca7a208107d6f9f4c393c5c \ + --hash=sha256:3b7a64d43e2a1fa2dd46b678e00cabd9a49ebb123b339ce799204c44a593ae1c \ + --hash=sha256:3c8c0226c71bd0ce9892eaf6afa77ae8f43a3d9313124a03df0b389c01f832de \ + --hash=sha256:429349a510da82c85431f0f3e66212d83efe9fd2850f50f339341b6532c62fe4 \ + --hash=sha256:466030a42724780794dea71eb32db83cc51214d66ab3fb3156edd88b9c8f0d78 \ + --hash=sha256:47aeceb4363851d17f63069318ba5721ae695d9da55d599b4d6fb31508595278 \ + --hash=sha256:48aa98987d54a46e13e6954880056c204700c65616af4395d1f0639eba11764b \ + --hash=sha256:4b2416ed743ec5debcf61e1242e012652a4348de14ecc7df3512da072b074440 \ + --hash=sha256:4d0a675a7acbbc16179188d8c6d0afb8628604fc1241faf41007255957335a0b \ + --hash=sha256:4eb74d44776b0fb0782560ea84d986dffec8ddd94947f383eba2284b0f32e35e \ + --hash=sha256:4f8a1d990dc198a6c68ec3d9a637ba1ce489b38cbfb65440a27901afbc5df575 \ + --hash=sha256:513ccbf7420c30e283c25c82d5a8f439d625a838d3ba69e79a110c260c46813f \ + --hash=sha256:5210a0018c7e09c75fa788648617ebba861ae242944111d3079034e14498223f \ + --hash=sha256:54cdfcda59251b9c2f87a05d038c2ae02121219a04d4a1e6fc345794295bdc07 \ + --hash=sha256:56dd500411d03c5e9927a1eb55621e906837a83b02350a9dc401247d0353717c \ + --hash=sha256:57ec6baec231bb19bb5fd5fc7bae21231860a1605174b11585660236627e390e \ + --hash=sha256:5f1519b080d8ce0a814f17ad9fb49fb3a1d4d7ce5891f5c85fc38631ca3a8dc4 \ + --hash=sha256:6174d6ad6b58a6bcf67afbbf1723420a53d06c4b89f4c50763d6fa0a6ac9afd2 \ + --hash=sha256:68172622a5a57deb079a2c78511c40f91193548e8ab342c31e8cb0764d362459 \ + --hash=sha256:6915fc9fa6b3ec3569566832e1bb03bd801c12cea030200e68663b9a87974e76 \ + --hash=sha256:6b75b912a0baa033350367a8a07a8b2d44fd5b90c890bfbd063a8a5f945f644b \ + --hash=sha256:6f5dcb658d597410bb7c967c1d24eaf9377b0d621358cbe9d2ff804e5dd12e81 \ + --hash=sha256:6f8d7fe73d1816eeb5378409adc658f9525ecbfaf9e1ede1e2d67a338b0c7348 \ + --hash=sha256:7036316cc26b93e401cedd781a579be606dad174829e6ad9e9c5a0da6e036f80 \ + --hash=sha256:7188ddc1a8887194f984fa4110d5a3d5b9b5cd35f6bafdff1b649049cbc0ce29 \ + --hash=sha256:761531076df51309075133a6bc1db02d98ec7f66e22b064b1d513bc909f29743 \ + --hash=sha256:7979d90ee2190d000129598c2b0c82f13053dba432b94e45e68253b09bb1f0f6 \ + --hash=sha256:8015835494b21aa7abd3b43fdea0614ee35ef6b03db7ecba9beb58eadf01c24f \ + --hash=sha256:81c4d1a3a564775c44732b94135d06e33417e829ff25226c164664f4a1046213 \ + --hash=sha256:81cf9d306c04df1b45971c13167dc3bad625808aa01281d55f3cf852dde0e206 \ + --hash=sha256:88857060b690a57d2ea8569bca58758143c8faa4639fb17d745ce60ff84c867e \ + --hash=sha256:8c567c664fc2f44130a20edac73e0a867f8e012bf7370276f15c6adc3586c37c \ + --hash=sha256:91bd2b7cf0f4d252eec8b7046fa6a43cee17e8acdfc00eaa8b3dbf2f9a59d061 \ + --hash=sha256:9620650c364c01ed5b497dcae7c3d4b948daeae6e1883ae185fef1c927b6b534 \ + --hash=sha256:9b007c2444705a2dc4a525964fd4dd28c3320b19b3410da6517cab28716f27d3 \ + --hash=sha256:9bf9acce44e967a5103fcd820fc7580c7b0ab8583eec4e2051aec560f7b31a63 \ + --hash=sha256:a239303acb0315091d54c7ff36712dba24554993b9a93941cf301391d8a997ee \ + --hash=sha256:a2baa6be130e8a00b6cbb9f18a33611ec150b4537f8563bddadb54c1b74b8193 \ + --hash=sha256:a54917b7e9cd3a67e429a630e237a90b096e0ba18897bfb99ee8bd1068a5fea0 \ + --hash=sha256:a689e1ded7137552bea36305a7a16ad2b40be511740b80748d3140614993db98 \ + --hash=sha256:a952ae3eb460c6712388ac2ec706d24b0e651b9396d90c9a9e0a69eb27737fdc \ + --hash=sha256:aa32205358a76bf578854bf31698a86dc8b2cb591fd1d79a833283f4a403f04b \ + --hash=sha256:b2287c09482949e0ca0c0eb68b2aca6cf57f8af8c6dfd29dcd3bc45f17b57978 \ + --hash=sha256:b6b0e17d39d21698185097652c611f9cf30f7c56ccec189789920e3e7f1cee56 \ + --hash=sha256:b710bf7e7ae61957d5c4026b486be593ed3ec3dca3e5be15e0f6d8cf5d0a4990 \ + --hash=sha256:b8e11715178f3608874508f08e990d3771e0b8c66c73eb4e183038d600a9b274 \ + --hash=sha256:b92aafcfab3d41580d54aca35a8057341f1cfc7c9af9e8bdfc652f83a20ced31 \ + --hash=sha256:bec29b801b4adbf388314c0d050e851d53762ab424af22657021ce4b6eb41543 \ + --hash=sha256:c694bee70ece3b232df4678448fdda245fd3b1bb4ba481fb6cd20e13bb784c46 \ + --hash=sha256:c6b52b7028b547866c2413f614ee306c2d4eafdd444b1ff656bf3295bf1484aa \ + --hash=sha256:cb41ad20064e18a900dd427d7cf41cfaec83bcd1184001f3d91a1f76b3fcea4e \ + --hash=sha256:cd316dbcc74c76266ba94eb021b0cc090b97cca122f50bd7a845f587ff4bf03f \ + --hash=sha256:ced40cdbb6dd47a032725a038896cceae9ce267d340f59508b23537f05455431 \ + --hash=sha256:d1c562a9bb72244fa767d1c1ab55ca1d92dd5f7c4d77878fee5483a22ffac808 \ + --hash=sha256:d389ff1e95b6e46ebedccf7fd1fadd10559add595ac6a7c2ea730268325f832c \ + --hash=sha256:d56b1cd606ba4cedd64bb43479d56580e147c6ef3f5d1c5e64203a1adab784a2 \ + --hash=sha256:d72a4315514e5a0b9837a086cb433b004eea630afb0cc129de76d77654a9606f \ + --hash=sha256:d9e7f29c00577aff6b318681e730a519b235af292732a149337f6aaa4d1c5e31 \ + --hash=sha256:dbc25baa6abb205766fb8606f8263b02c3503a55957fcb4576a6bb0a59d37d10 \ + --hash=sha256:e57919c32ee295a2fca458bb73e4b20b05c115627f96f95a10f9f5acbd61172d \ + --hash=sha256:e5bbe011a2cea9060fef1bb3d668a2fd8432b8888e6d92e74c9c794d3c101595 \ + --hash=sha256:e6aea5c0eb5b0faf52c7b5c4a47c8bb64437173be97227c819ffa31801fa4e34 \ + --hash=sha256:e888be685fa42d8b8a3d3911d5604d14db87538aa7d0b29b1a7ea80d354c732d \ + --hash=sha256:eebaf8c76c39604d52852366249ab807fe6f7a3ffb0dd5484b9944917244cdbe \ + --hash=sha256:efbe0b5e0fd078ed7b005faa0170da4f72666360f66f0bb2d7f73526ecfd99f9 \ + --hash=sha256:efddca2d02254a52078c35cadad34762adbae3ff01c6b0c7787b59d038b63e0d \ + --hash=sha256:f05450fa1cd7c525c0b9d1a7916e595d3041ac0afbed2ff6926e5afb6a781b7f \ + --hash=sha256:f12d69d568f5647ec503b64932874dade5a20255736c89936bf690951a5e79f5 \ + --hash=sha256:f45321224144c25a62052035ce96cbcf264667bcb0d81823b1bbc22c4addd194 \ + --hash=sha256:f62581d7e884dd01ee1707b7c21148f61f2febb7de092ae2f108743fcbef5985 \ + --hash=sha256:f8832a4f83d4782a8f5a7b831c47e8ffe164e43c2c148c8160ed9a6d630bc02a \ + --hash=sha256:fa35ad36440aaf1ac8332b4a4a433d4acd28f1613f0d480995f5cfd3580e90b7 + # via + # jsonschema + # referencing tomli==2.0.1 \ --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f # via pytest -typing-extensions==4.7.1 \ - --hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \ - --hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2 - # via - # cattrs - # importlib-metadata - # jsonschema -zipp==3.15.0 \ - --hash=sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b \ - --hash=sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556 - # via - # importlib-metadata - # importlib-resources +typing-extensions==4.8.0 \ + --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ + --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef + # via cattrs +zipp==3.17.0 \ + --hash=sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31 \ + --hash=sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0 + # via importlib-resources diff --git a/runtime.txt b/runtime.txt index ebf3e31..7739b5a 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.7.16 \ No newline at end of file +python-3.8.18 \ No newline at end of file From 0e5abb14b3529ba263a0b86ed89aa91e8bf035a9 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 6 Nov 2023 12:22:50 -0800 Subject: [PATCH 07/27] vNext LSP --- generator/lsp.json | 3864 ++++++++++++++------------- packages/python/lsprotocol/types.py | 1691 ++++++++---- packages/rust/lsprotocol/src/lib.rs | 1633 ++++++----- scripts/onCreateCommand.sh | 4 +- 4 files changed, 4135 insertions(+), 3057 deletions(-) diff --git a/generator/lsp.json b/generator/lsp.json index 29f33f6..c4e7adb 100644 --- a/generator/lsp.json +++ b/generator/lsp.json @@ -4299,28 +4299,8 @@ { "name": "serverInfo", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of the server as defined by the server." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The server's version as defined by the server." - } - ] - } + "kind": "reference", + "name": "ServerInfo" }, "optional": true, "documentation": "Information about the server.\n\n@since 3.15.0", @@ -4954,90 +4934,8 @@ { "name": "itemDefaults", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "commitCharacters", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "A default commit character set.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "editRange", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Range" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "insert", - "type": { - "kind": "reference", - "name": "Range" - } - }, - { - "name": "replace", - "type": { - "kind": "reference", - "name": "Range" - } - } - ] - } - } - ] - }, - "optional": true, - "documentation": "A default edit range.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "insertTextFormat", - "type": { - "kind": "reference", - "name": "InsertTextFormat" - }, - "optional": true, - "documentation": "A default insert text format.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "insertTextMode", - "type": { - "kind": "reference", - "name": "InsertTextMode" - }, - "optional": true, - "documentation": "A default insert text mode.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A default data value.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } + "kind": "reference", + "name": "CompletionItemDefaults" }, "optional": true, "documentation": "In many cases the items of an actual completion result share the same\nvalue for properties like `commitCharacters` or the range of a text\nedit. A completion list can therefore define item defaults which will\nbe used if a completion item itself doesn't specify the value.\n\nIf a completion list specifies a default value and a completion item\nalso specifies a corresponding value the one from the item is used.\n\nServers are only allowed to return default values if the client\nsignals support for this via the `completionList.itemDefaults`\ncapability.\n\n@since 3.17.0", @@ -5630,19 +5528,8 @@ { "name": "disabled", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "reason", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "Human readable description of why the code action is currently disabled.\n\nThis is displayed in the code actions UI." - } - ] - } + "kind": "reference", + "name": "CodeActionDisabled" }, "optional": true, "documentation": "Marks that the code action cannot currently be applied.\n\nClients should follow the following guidelines regarding disabled code actions:\n\n - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)\n code action menus.\n\n - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type\n of code action, such as refactorings.\n\n - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)\n that auto applies a code action and only disabled code actions are returned, the client should show the user an\n error message with `reason` in the editor.\n\n@since 3.16.0", @@ -5731,18 +5618,8 @@ "name": "Location" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - } - } - ] - } + "kind": "reference", + "name": "LocationUriOnly" } ] }, @@ -6831,20 +6708,8 @@ "name": "boolean" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "delta", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server supports deltas for full documents." - } - ] - } + "kind": "reference", + "name": "SemanticTokensFullDelta" } ] }, @@ -7725,99 +7590,8 @@ { "name": "cells", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "structure", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "array", - "type": { - "kind": "reference", - "name": "NotebookCellArrayChange" - }, - "documentation": "The change to the cell array." - }, - { - "name": "didOpen", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentItem" - } - }, - "optional": true, - "documentation": "Additional opened cell text documents." - }, - { - "name": "didClose", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentIdentifier" - } - }, - "optional": true, - "documentation": "Additional closed cell text documents." - } - ] - } - }, - "optional": true, - "documentation": "Changes to the cell structure to add or\nremove cells." - }, - { - "name": "data", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "NotebookCell" - } - }, - "optional": true, - "documentation": "Changes to notebook cells properties like its\nkind, execution summary or metadata." - }, - { - "name": "textContent", - "type": { - "kind": "array", - "element": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "document", - "type": { - "kind": "reference", - "name": "VersionedTextDocumentIdentifier" - } - }, - { - "name": "changes", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentContentChangeEvent" - } - } - } - ] - } - } - }, - "optional": true, - "documentation": "Changes to the text content of notebook cells." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentCellChanges" }, "optional": true, "documentation": "Changes to cells" @@ -7979,28 +7753,8 @@ { "name": "clientInfo", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of the client as defined by the client." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The client's version as defined by the client." - } - ] - } + "kind": "reference", + "name": "ClientInfo" }, "optional": true, "documentation": "Information about the client\n\n@since 3.15.0", @@ -8730,31 +8484,8 @@ { "name": "workspace", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "workspaceFolders", - "type": { - "kind": "reference", - "name": "WorkspaceFoldersServerCapabilities" - }, - "optional": true, - "documentation": "The server supports workspace folder.\n\n@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "fileOperations", - "type": { - "kind": "reference", - "name": "FileOperationOptions" - }, - "optional": true, - "documentation": "The server is interested in notifications/requests for operations on files.\n\n@since 3.16.0", - "since": "3.16.0" - } - ] - } + "kind": "reference", + "name": "WorkspaceOptions" }, "optional": true, "documentation": "Workspace specific server capabilities." @@ -8771,6 +8502,31 @@ ], "documentation": "Defines the capabilities provided by a language\nserver." }, + { + "name": "ServerInfo", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the server as defined by the server." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The server's version as defined by the server." + } + ], + "documentation": "Information about the server\n\n@since 3.15.0\n@since 3.18.0 ServerInfo type name added.\n@proposed", + "since": "3.18.0 ServerInfo type name added.", + "proposed": true + }, { "name": "VersionedTextDocumentIdentifier", "properties": [ @@ -9033,6 +8789,75 @@ "documentation": "A special text edit to provide an insert and a replace operation.\n\n@since 3.16.0", "since": "3.16.0" }, + { + "name": "CompletionItemDefaults", + "properties": [ + { + "name": "commitCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "A default commit character set.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "editRange", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Range" + }, + { + "kind": "reference", + "name": "EditRangeWithInsertReplace" + } + ] + }, + "optional": true, + "documentation": "A default edit range.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "insertTextFormat", + "type": { + "kind": "reference", + "name": "InsertTextFormat" + }, + "optional": true, + "documentation": "A default insert text format.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "A default insert text mode.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A default data value.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "In many cases the items of an actual completion result share the same\nvalue for properties like `commitCharacters` or the range of a text\nedit. A completion list can therefore define item defaults which will\nbe used if a completion item itself doesn't specify the value.\n\nIf a completion list specifies a default value and a completion item\nalso specifies a corresponding value the one from the item is used.\n\nServers are only allowed to return default values if the client\nsignals support for this via the `completionList.itemDefaults`\ncapability.\n\n@since 3.17.0", + "since": "3.17.0" + }, { "name": "CompletionOptions", "properties": [ @@ -9073,21 +8898,8 @@ { "name": "completionItem", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "labelDetailsSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server has support for completion item label\ndetails (see also `CompletionItemLabelDetails`) when\nreceiving a completion item in a resolve call.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } + "kind": "reference", + "name": "ServerCompletionItemOptions" }, "optional": true, "documentation": "The server supports the following `CompletionItem` specific\ncapabilities.\n\n@since 3.17.0", @@ -9397,6 +9209,22 @@ ], "documentation": "Contains additional diagnostic information about the context in which\na {@link CodeActionProvider.provideCodeActions code action} is run." }, + { + "name": "CodeActionDisabled", + "properties": [ + { + "name": "reason", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Human readable description of why the code action is currently disabled.\n\nThis is displayed in the code actions UI." + } + ], + "documentation": "Captures why the code action is currently disabled.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "CodeActionOptions", "properties": [ @@ -9431,6 +9259,21 @@ ], "documentation": "Provider options for a {@link CodeActionRequest}." }, + { + "name": "LocationUriOnly", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + } + } + ], + "documentation": "Location with only uri and does not include range.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "WorkspaceSymbolOptions", "properties": [ @@ -9629,6 +9472,43 @@ ], "documentation": "Provider options for a {@link RenameRequest}." }, + { + "name": "PrepareRenamePlaceholder", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "placeholder", + "type": { + "kind": "base", + "name": "string" + } + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "PrepareRenameDefaultBehavior", + "properties": [ + { + "name": "defaultBehavior", + "type": { + "kind": "base", + "name": "boolean" + } + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "ExecuteCommandOptions", "properties": [ @@ -9681,6 +9561,23 @@ "documentation": "@since 3.16.0", "since": "3.16.0" }, + { + "name": "SemanticTokensFullDelta", + "properties": [ + { + "name": "delta", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server supports deltas for full documents." + } + ], + "documentation": "Semantic tokens options to support deltas for full documents\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "OptionalVersionedTextDocumentIdentifier", "properties": [ @@ -9978,26 +9875,19 @@ "since": "3.17.0" }, { - "name": "NotebookCellArrayChange", + "name": "NotebookDocumentCellChanges", "properties": [ { - "name": "start", + "name": "structure", "type": { - "kind": "base", - "name": "uinteger" + "kind": "reference", + "name": "NotebookDocumentCellChangeStructure" }, - "documentation": "The start oftest of the cell that changed." + "optional": true, + "documentation": "Changes to the cell structure to add or\nremove cells." }, { - "name": "deleteCount", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The deleted cells" - }, - { - "name": "cells", + "name": "data", "type": { "kind": "array", "element": { @@ -10006,11 +9896,24 @@ } }, "optional": true, - "documentation": "The new cells, if any" + "documentation": "Changes to notebook cells properties like its\nkind, execution summary or metadata." + }, + { + "name": "textContent", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookDocumentCellContentChanges" + } + }, + "optional": true, + "documentation": "Changes to the text content of notebook cells." } ], - "documentation": "A change describing how to move a `NotebookCell`\narray from state S to S'.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "Cell changes to a notebook document.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "SelectedCompletionInfo", @@ -10036,6 +9939,31 @@ "since": "3.18.0", "proposed": true }, + { + "name": "ClientInfo", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the client as defined by the client." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The client's version as defined by the client." + } + ], + "documentation": "Information about the client\n\n@since 3.15.0\n@since 3.18.0 ClientInfo type name added.\n@proposed", + "since": "3.18.0 ClientInfo type name added.", + "proposed": true + }, { "name": "ClientCapabilities", "properties": [ @@ -10168,96 +10096,12 @@ "kind": "or", "items": [ { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebook", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "NotebookDocumentFilter" - } - ] - }, - "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } - } - }, - "optional": true, - "documentation": "The cells of the matching notebook to be synced." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterWithNotebook" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebook", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "NotebookDocumentFilter" - } - ] - }, - "optional": true, - "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } - } - }, - "documentation": "The cells of the matching notebook to be synced." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterWithCells" } ] } @@ -10296,97 +10140,82 @@ "since": "3.17.0" }, { - "name": "WorkspaceFoldersServerCapabilities", + "name": "WorkspaceOptions", "properties": [ { - "name": "supported", + "name": "workspaceFolders", "type": { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "WorkspaceFoldersServerCapabilities" }, "optional": true, - "documentation": "The server has support for workspace folders" + "documentation": "The server supports workspace folder.\n\n@since 3.6.0", + "since": "3.6.0" }, { - "name": "changeNotifications", + "name": "fileOperations", "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "base", - "name": "boolean" - } - ] + "kind": "reference", + "name": "FileOperationOptions" }, "optional": true, - "documentation": "Whether the server wants to receive workspace folder\nchange notifications.\n\nIf a string is provided the string is treated as an ID\nunder which the notification is registered on the client\nside. The ID can be used to unregister for these events\nusing the `client/unregisterCapability` request." + "documentation": "The server is interested in notifications/requests for operations on files.\n\n@since 3.16.0", + "since": "3.16.0" } - ] + ], + "documentation": "Defines workspace specific capabilities of the server.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "FileOperationOptions", + "name": "TextDocumentContentChangePartial", "properties": [ { - "name": "didCreate", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving didCreateFiles notifications." - }, - { - "name": "willCreate", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving willCreateFiles requests." - }, - { - "name": "didRename", + "name": "range", "type": { "kind": "reference", - "name": "FileOperationRegistrationOptions" + "name": "Range" }, - "optional": true, - "documentation": "The server is interested in receiving didRenameFiles notifications." + "documentation": "The range of the document that changed." }, { - "name": "willRename", + "name": "rangeLength", "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" + "kind": "base", + "name": "uinteger" }, "optional": true, - "documentation": "The server is interested in receiving willRenameFiles requests." + "documentation": "The optional length of the range that got replaced.\n\n@deprecated use range instead.", + "deprecated": "use range instead." }, { - "name": "didDelete", + "name": "text", "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" + "kind": "base", + "name": "string" }, - "optional": true, - "documentation": "The server is interested in receiving didDeleteFiles file notifications." - }, + "documentation": "The new text for the provided range." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "TextDocumentContentChangeWholeDocument", + "properties": [ { - "name": "willDelete", + "name": "text", "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" + "kind": "base", + "name": "string" }, - "optional": true, - "documentation": "The server is interested in receiving willDeleteFiles file requests." + "documentation": "The new text of the whole document." } ], - "documentation": "Options for notifications/requests for user operations on files.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { "name": "CodeDescription", @@ -10425,6 +10254,69 @@ ], "documentation": "Represents a related message and source code location for a diagnostic. This should be\nused to point to code locations that cause or related to a diagnostics, e.g when duplicating\na symbol in a scope." }, + { + "name": "EditRangeWithInsertReplace", + "properties": [ + { + "name": "insert", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "replace", + "type": { + "kind": "reference", + "name": "Range" + } + } + ], + "documentation": "Edit range variant that includes ranges for insert and replace operations.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ServerCompletionItemOptions", + "properties": [ + { + "name": "labelDetailsSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server has support for completion item label\ndetails (see also `CompletionItemLabelDetails`) when\nreceiving a completion item in a resolve call.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "MarkedStringWithLanguage", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + } + } + ], + "documentation": "@since 3.18.0\n@proposed\n@deprecated use MarkupContent instead.", + "since": "3.18.0", + "deprecated": "use MarkupContent instead.", + "proposed": true + }, { "name": "ParameterInformation", "properties": [ @@ -10546,6 +10438,71 @@ } ] }, + { + "name": "NotebookDocumentCellChangeStructure", + "properties": [ + { + "name": "array", + "type": { + "kind": "reference", + "name": "NotebookCellArrayChange" + }, + "documentation": "The change to the cell array." + }, + { + "name": "didOpen", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentItem" + } + }, + "optional": true, + "documentation": "Additional opened cell text documents." + }, + { + "name": "didClose", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + }, + "optional": true, + "documentation": "Additional closed cell text documents." + } + ], + "documentation": "Structural changes to cells in a notebook document.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookDocumentCellContentChanges", + "properties": [ + { + "name": "document", + "type": { + "kind": "reference", + "name": "VersionedTextDocumentIdentifier" + } + }, + { + "name": "changes", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentContentChangeEvent" + } + } + } + ], + "documentation": "Content changes to a cell in a notebook document.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "WorkspaceClientCapabilities", "properties": [ @@ -11054,30 +11011,8 @@ { "name": "staleRequestSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "cancel", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "The client will actively cancel the request." - }, - { - "name": "retryOnContentModified", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The list of requests for which the client\nwill retry the request if it receives a\nresponse with error code `ContentModified`" - } - ] - } + "kind": "reference", + "name": "StaleRequestSupportOptions" }, "optional": true, "documentation": "Client capability that signals how the client\nhandles stale requests (e.g. a request\nfor which the client will not process the response\nanymore since the information is outdated).\n\n@since 3.17.0", @@ -11121,16 +11056,183 @@ "since": "3.16.0" }, { - "name": "RelativePattern", + "name": "NotebookDocumentFilterWithNotebook", "properties": [ { - "name": "baseUri", + "name": "notebook", "type": { "kind": "or", "items": [ { - "kind": "reference", - "name": "WorkspaceFolder" + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCellLanguage" + } + }, + "optional": true, + "documentation": "The cells of the matching notebook to be synced." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookDocumentFilterWithCells", + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "optional": true, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCellLanguage" + } + }, + "documentation": "The cells of the matching notebook to be synced." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "WorkspaceFoldersServerCapabilities", + "properties": [ + { + "name": "supported", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server has support for workspace folders" + }, + { + "name": "changeNotifications", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "base", + "name": "boolean" + } + ] + }, + "optional": true, + "documentation": "Whether the server wants to receive workspace folder\nchange notifications.\n\nIf a string is provided the string is treated as an ID\nunder which the notification is registered on the client\nside. The ID can be used to unregister for these events\nusing the `client/unregisterCapability` request." + } + ] + }, + { + "name": "FileOperationOptions", + "properties": [ + { + "name": "didCreate", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didCreateFiles notifications." + }, + { + "name": "willCreate", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willCreateFiles requests." + }, + { + "name": "didRename", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didRenameFiles notifications." + }, + { + "name": "willRename", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willRenameFiles requests." + }, + { + "name": "didDelete", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didDeleteFiles file notifications." + }, + { + "name": "willDelete", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willDeleteFiles file requests." + } + ], + "documentation": "Options for notifications/requests for user operations on files.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RelativePattern", + "properties": [ + { + "name": "baseUri", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceFolder" }, { "kind": "base", @@ -11153,76 +11255,629 @@ "since": "3.17.0" }, { - "name": "WorkspaceEditClientCapabilities", + "name": "TextDocumentFilterLanguage", "properties": [ { - "name": "documentChanges", + "name": "language", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, - "optional": true, - "documentation": "The client supports versioned document changes in `WorkspaceEdit`s" + "documentation": "A language id, like `typescript`." }, { - "name": "resourceOperations", + "name": "scheme", "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ResourceOperationKind" - } + "kind": "base", + "name": "string" }, "optional": true, - "documentation": "The resource operations the client supports. Clients should at least\nsupport 'create', 'rename' and 'delete' files and folders.\n\n@since 3.13.0", - "since": "3.13.0" + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." }, { - "name": "failureHandling", + "name": "pattern", "type": { - "kind": "reference", - "name": "FailureHandlingKind" + "kind": "base", + "name": "string" }, "optional": true, - "documentation": "The failure handling strategy of a client if applying the workspace edit\nfails.\n\n@since 3.13.0", - "since": "3.13.0" + "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." + } + ], + "documentation": "A document filter where `language` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "TextDocumentFilterScheme", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`." }, { - "name": "normalizesLineEndings", + "name": "scheme", "type": { "kind": "base", - "name": "boolean" + "name": "string" + }, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" }, "optional": true, - "documentation": "Whether the client normalizes line endings to the client specific\nsetting.\nIf set to `true` the client will normalize line ending characters\nin a workspace edit to the client-specified new line\ncharacter.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." + } + ], + "documentation": "A document filter where `scheme` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "TextDocumentFilterPattern", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`." }, { - "name": "changeAnnotationSupport", + "name": "scheme", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "groupsOnLabel", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client groups edits with equal labels into tree nodes,\nfor instance all edits labelled with \"Changes in Strings\" would\nbe a tree node." - } - ] - } + "kind": "base", + "name": "string" }, "optional": true, - "documentation": "Whether the client in general supports change annotations on text edits,\ncreate file, rename file and delete file changes.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." + } + ], + "documentation": "A document filter where `pattern` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookCellArrayChange", + "properties": [ + { + "name": "start", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The start oftest of the cell that changed." + }, + { + "name": "deleteCount", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The deleted cells" + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCell" + } + }, + "optional": true, + "documentation": "The new cells, if any" + } + ], + "documentation": "A change describing how to move a `NotebookCell`\narray from state S to S'.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceEditClientCapabilities", + "properties": [ + { + "name": "documentChanges", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports versioned document changes in `WorkspaceEdit`s" + }, + { + "name": "resourceOperations", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ResourceOperationKind" + } + }, + "optional": true, + "documentation": "The resource operations the client supports. Clients should at least\nsupport 'create', 'rename' and 'delete' files and folders.\n\n@since 3.13.0", + "since": "3.13.0" + }, + { + "name": "failureHandling", + "type": { + "kind": "reference", + "name": "FailureHandlingKind" + }, + "optional": true, + "documentation": "The failure handling strategy of a client if applying the workspace edit\nfails.\n\n@since 3.13.0", + "since": "3.13.0" + }, + { + "name": "normalizesLineEndings", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client normalizes line endings to the client specific\nsetting.\nIf set to `true` the client will normalize line ending characters\nin a workspace edit to the client-specified new line\ncharacter.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "changeAnnotationSupport", + "type": { + "kind": "reference", + "name": "ChangeAnnotationsSupportOptions" + }, + "optional": true, + "documentation": "Whether the client in general supports change annotations on text edits,\ncreate file, rename file and delete file changes.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + }, + { + "name": "DidChangeConfigurationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Did change configuration notification supports dynamic registration." + } + ] + }, + { + "name": "DidChangeWatchedFilesClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Did change watched files notification supports dynamic registration. Please note\nthat the current protocol doesn't support static configuration for file changes\nfrom the server side." + }, + { + "name": "relativePatternSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client has support for {@link RelativePattern relative pattern}\nor not.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + }, + { + "name": "WorkspaceSymbolClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Symbol request supports dynamic registration." + }, + { + "name": "symbolKind", + "type": { + "kind": "reference", + "name": "ClientSymbolKindOptions" + }, + "optional": true, + "documentation": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request." + }, + { + "name": "tagSupport", + "type": { + "kind": "reference", + "name": "ClientSymbolTagOptions" + }, + "optional": true, + "documentation": "The client supports tags on `SymbolInformation`.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "resolveSupport", + "type": { + "kind": "reference", + "name": "ClientSymbolResolveOptions" + }, + "optional": true, + "documentation": "The client support partial workspace symbols. The client will send the\nrequest `workspaceSymbol/resolve` to the server to resolve additional\nproperties.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Client capabilities for a {@link WorkspaceSymbolRequest}." + }, + { + "name": "ExecuteCommandClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Execute command supports dynamic registration." + } + ], + "documentation": "The client capabilities of a {@link ExecuteCommandRequest}." + }, + { + "name": "SemanticTokensWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\nsemantic tokens currently shown. It should be used with absolute care\nand is useful for situation where a server for example detects a project\nwide change that requires such a calculation." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CodeLensWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ncode lenses currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detect a project wide\nchange that requires such a calculation." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileOperationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports dynamic registration for file requests/notifications." + }, + { + "name": "didCreate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didCreateFiles notifications." + }, + { + "name": "willCreate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willCreateFiles requests." + }, + { + "name": "didRename", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didRenameFiles notifications." + }, + { + "name": "willRename", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willRenameFiles requests." + }, + { + "name": "didDelete", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didDeleteFiles notifications." + }, + { + "name": "willDelete", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willDeleteFiles requests." + } + ], + "documentation": "Capabilities relating to events from file operations by the user in the client.\n\nThese events do not come from the file system, they come from user operations\nlike renaming a file in the UI.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "InlineValueWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ninline values currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Client workspace capabilities specific to inline values.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\ninlay hints currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Client workspace capabilities specific to inlay hints.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\npulled diagnostics currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Workspace client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FoldingRangeWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\nfolding ranges currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + } + ], + "documentation": "Client workspace capabilities specific to folding ranges\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "TextDocumentSyncClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether text document synchronization supports dynamic registration." + }, + { + "name": "willSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending will save notifications." + }, + { + "name": "willSaveWaitUntil", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending a will save request and\nwaits for a response providing text edits which will\nbe applied to the document before it is saved." + }, + { + "name": "didSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports did save notifications." + } + ] + }, + { + "name": "CompletionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether completion supports dynamic registration." + }, + { + "name": "completionItem", + "type": { + "kind": "reference", + "name": "ClientCompletionItemOptions" + }, + "optional": true, + "documentation": "The client supports the following `CompletionItem` specific\ncapabilities." + }, + { + "name": "completionItemKind", + "type": { + "kind": "reference", + "name": "ClientCompletionItemOptionsKind" + }, + "optional": true + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "Defines how the client handles whitespace and indentation\nwhen accepting a completion item that uses multi line\ntext in either `insertText` or `textEdit`.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "contextSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports to send additional context information for a\n`textDocument/completion` request." + }, + { + "name": "completionList", + "type": { + "kind": "reference", + "name": "CompletionListCapabilities" + }, + "optional": true, + "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Completion client capabilities" + }, + { + "name": "HoverClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether hover supports dynamic registration." + }, + { + "name": "contentFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" + } + }, + "optional": true, + "documentation": "Client supports the following content formats for the content\nproperty. The order describes the preferred format of the client." + } + ] + }, + { + "name": "SignatureHelpClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether signature help supports dynamic registration." + }, + { + "name": "signatureInformation", + "type": { + "kind": "reference", + "name": "ClientSignatureInformationOptions" + }, + "optional": true, + "documentation": "The client supports the following `SignatureInformation`\nspecific properties." + }, + { + "name": "contextSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports to send additional context information for a\n`textDocument/signatureHelp` request. A client that opts into\ncontextSupport will also support the `retriggerCharacters` on\n`SignatureHelpOptions`.\n\n@since 3.15.0", + "since": "3.15.0" } - ] + ], + "documentation": "Client Capabilities for a {@link SignatureHelpRequest}." }, { - "name": "DidChangeConfigurationClientCapabilities", + "name": "DeclarationClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11231,12 +11886,23 @@ "name": "boolean" }, "optional": true, - "documentation": "Did change configuration notification supports dynamic registration." + "documentation": "Whether declaration supports dynamic registration. If this is set to `true`\nthe client supports the new `DeclarationRegistrationOptions` return value\nfor the corresponding server capability as well." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of declaration links." } - ] + ], + "documentation": "@since 3.14.0", + "since": "3.14.0" }, { - "name": "DidChangeWatchedFilesClientCapabilities", + "name": "DefinitionClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11245,22 +11911,23 @@ "name": "boolean" }, "optional": true, - "documentation": "Did change watched files notification supports dynamic registration. Please note\nthat the current protocol doesn't support static configuration for file changes\nfrom the server side." + "documentation": "Whether definition supports dynamic registration." }, { - "name": "relativePatternSupport", + "name": "linkSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client has support for {@link RelativePattern relative pattern}\nor not.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", + "since": "3.14.0" } - ] + ], + "documentation": "Client Capabilities for a {@link DefinitionRequest}." }, { - "name": "WorkspaceSymbolClientCapabilities", + "name": "TypeDefinitionClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11269,85 +11936,48 @@ "name": "boolean" }, "optional": true, - "documentation": "Symbol request supports dynamic registration." + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `TypeDefinitionRegistrationOptions` return value\nfor the corresponding server capability as well." }, { - "name": "symbolKind", + "name": "linkSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolKind" - } - }, - "optional": true, - "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." - } - ] - } + "kind": "base", + "name": "boolean" }, "optional": true, - "documentation": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request." - }, + "documentation": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0" + } + ], + "documentation": "Since 3.6.0" + }, + { + "name": "ImplementationClientCapabilities", + "properties": [ { - "name": "tagSupport", + "name": "dynamicRegistration", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } + "kind": "base", + "name": "boolean" }, "optional": true, - "documentation": "The client supports tags on `SymbolInformation`.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `ImplementationRegistrationOptions` return value\nfor the corresponding server capability as well." }, { - "name": "resolveSupport", + "name": "linkSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily. Usually\n`location.range`" - } - ] - } + "kind": "base", + "name": "boolean" }, "optional": true, - "documentation": "The client support partial workspace symbols. The client will send the\nrequest `workspaceSymbol/resolve` to the server to resolve additional\nproperties.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", + "since": "3.14.0" } ], - "documentation": "Client capabilities for a {@link WorkspaceSymbolRequest}." + "documentation": "@since 3.6.0", + "since": "3.6.0" }, { - "name": "ExecuteCommandClientCapabilities", + "name": "ReferenceClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11356,45 +11986,81 @@ "name": "boolean" }, "optional": true, - "documentation": "Execute command supports dynamic registration." + "documentation": "Whether references supports dynamic registration." } ], - "documentation": "The client capabilities of a {@link ExecuteCommandRequest}." + "documentation": "Client Capabilities for a {@link ReferencesRequest}." }, { - "name": "SemanticTokensWorkspaceClientCapabilities", + "name": "DocumentHighlightClientCapabilities", "properties": [ { - "name": "refreshSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\nsemantic tokens currently shown. It should be used with absolute care\nand is useful for situation where a server for example detects a project\nwide change that requires such a calculation." + "documentation": "Whether document highlight supports dynamic registration." } ], - "documentation": "@since 3.16.0", - "since": "3.16.0" + "documentation": "Client Capabilities for a {@link DocumentHighlightRequest}." }, { - "name": "CodeLensWorkspaceClientCapabilities", + "name": "DocumentSymbolClientCapabilities", "properties": [ { - "name": "refreshSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ncode lenses currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detect a project wide\nchange that requires such a calculation." + "documentation": "Whether document symbol supports dynamic registration." + }, + { + "name": "symbolKind", + "type": { + "kind": "reference", + "name": "ClientSymbolKindOptions" + }, + "optional": true, + "documentation": "Specific capabilities for the `SymbolKind` in the\n`textDocument/documentSymbol` request." + }, + { + "name": "hierarchicalDocumentSymbolSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports hierarchical document symbols." + }, + { + "name": "tagSupport", + "type": { + "kind": "reference", + "name": "ClientSymbolTagOptions" + }, + "optional": true, + "documentation": "The client supports tags on `SymbolInformation`. Tags are supported on\n`DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "labelSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports an additional label presented in the UI when\nregistering a document symbol provider.\n\n@since 3.16.0", + "since": "3.16.0" } ], - "documentation": "@since 3.16.0", - "since": "3.16.0" + "documentation": "Client Capabilities for a {@link DocumentSymbolRequest}." }, { - "name": "FileOperationClientCapabilities", + "name": "CodeActionClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11403,135 +12069,183 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether the client supports dynamic registration for file requests/notifications." + "documentation": "Whether code action supports dynamic registration." }, { - "name": "didCreate", + "name": "codeActionLiteralSupport", + "type": { + "kind": "reference", + "name": "ClientCodeActionLiteralOptions" + }, + "optional": true, + "documentation": "The client support code action literals of type `CodeAction` as a valid\nresponse of the `textDocument/codeAction` request. If the property is not\nset the request can only return `Command` literals.\n\n@since 3.8.0", + "since": "3.8.0" + }, + { + "name": "isPreferredSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client has support for sending didCreateFiles notifications." + "documentation": "Whether code action supports the `isPreferred` property.\n\n@since 3.15.0", + "since": "3.15.0" }, { - "name": "willCreate", + "name": "disabledSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client has support for sending willCreateFiles requests." + "documentation": "Whether code action supports the `disabled` property.\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "didRename", + "name": "dataSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client has support for sending didRenameFiles notifications." + "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/codeAction` and a\n`codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "willRename", + "name": "resolveSupport", + "type": { + "kind": "reference", + "name": "ClientCodeActionResolveOptions" + }, + "optional": true, + "documentation": "Whether the client supports resolving additional code action\nproperties via a separate `codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "honorsChangeAnnotations", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client has support for sending willRenameFiles requests." - }, + "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\n`CodeAction#edit` property by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "The Client Capabilities of a {@link CodeActionRequest}." + }, + { + "name": "CodeLensClientCapabilities", + "properties": [ { - "name": "didDelete", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client has support for sending didDeleteFiles notifications." + "documentation": "Whether code lens supports dynamic registration." + } + ], + "documentation": "The client capabilities of a {@link CodeLensRequest}." + }, + { + "name": "DocumentLinkClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether document link supports dynamic registration." }, { - "name": "willDelete", + "name": "tooltipSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client has support for sending willDeleteFiles requests." + "documentation": "Whether the client supports the `tooltip` property on `DocumentLink`.\n\n@since 3.15.0", + "since": "3.15.0" } ], - "documentation": "Capabilities relating to events from file operations by the user in the client.\n\nThese events do not come from the file system, they come from user operations\nlike renaming a file in the UI.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "The client capabilities of a {@link DocumentLinkRequest}." }, { - "name": "InlineValueWorkspaceClientCapabilities", + "name": "DocumentColorClientCapabilities", "properties": [ { - "name": "refreshSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ninline values currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation." + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `DocumentColorRegistrationOptions` return value\nfor the corresponding server capability as well." } - ], - "documentation": "Client workspace capabilities specific to inline values.\n\n@since 3.17.0", - "since": "3.17.0" + ] }, { - "name": "InlayHintWorkspaceClientCapabilities", + "name": "DocumentFormattingClientCapabilities", "properties": [ { - "name": "refreshSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\ninlay hints currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + "documentation": "Whether formatting supports dynamic registration." } ], - "documentation": "Client workspace capabilities specific to inlay hints.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "Client capabilities of a {@link DocumentFormattingRequest}." }, { - "name": "DiagnosticWorkspaceClientCapabilities", + "name": "DocumentRangeFormattingClientCapabilities", "properties": [ { - "name": "refreshSupport", + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether range formatting supports dynamic registration." + }, + { + "name": "rangesSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\npulled diagnostics currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + "documentation": "Whether the client supports formatting multiple ranges at once.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true } ], - "documentation": "Workspace client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "Client capabilities of a {@link DocumentRangeFormattingRequest}." }, { - "name": "FoldingRangeWorkspaceClientCapabilities", + "name": "DocumentOnTypeFormattingClientCapabilities", "properties": [ { - "name": "refreshSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\nfolding ranges currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Whether on type formatting supports dynamic registration." } ], - "documentation": "Client workspace capabilities specific to folding ranges\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Client capabilities of a {@link DocumentOnTypeFormattingRequest}." }, { - "name": "TextDocumentSyncClientCapabilities", + "name": "RenameClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11540,39 +12254,42 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether text document synchronization supports dynamic registration." + "documentation": "Whether rename supports dynamic registration." }, { - "name": "willSave", + "name": "prepareSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports sending will save notifications." + "documentation": "Client supports testing for validity of rename operations\nbefore execution.\n\n@since 3.12.0", + "since": "3.12.0" }, { - "name": "willSaveWaitUntil", + "name": "prepareSupportDefaultBehavior", "type": { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "PrepareSupportDefaultBehavior" }, "optional": true, - "documentation": "The client supports sending a will save request and\nwaits for a response providing text edits which will\nbe applied to the document before it is saved." + "documentation": "Client supports the default behavior result.\n\nThe value indicates the default behavior used by the\nclient.\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "didSave", + "name": "honorsChangeAnnotations", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports did save notifications." + "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\nrename request's workspace edit by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", + "since": "3.16.0" } ] }, { - "name": "CompletionClientCapabilities", + "name": "FoldingRangeClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11581,339 +12298,119 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether completion supports dynamic registration." + "documentation": "Whether implementation supports dynamic registration for folding range\nproviders. If this is set to `true` the client supports the new\n`FoldingRangeRegistrationOptions` return value for the corresponding\nserver capability as well." }, { - "name": "completionItem", + "name": "rangeLimit", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "snippetSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports snippets as insert text.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too." - }, - { - "name": "commitCharactersSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports commit characters on a completion item." - }, - { - "name": "documentationFormat", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "MarkupKind" - } - }, - "optional": true, - "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." - }, - { - "name": "deprecatedSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports the deprecated property on a completion item." - }, - { - "name": "preselectSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports the preselect property on a completion item." - }, - { - "name": "tagSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItemTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } - }, - "optional": true, - "documentation": "Client supports the tag property on a completion item. Clients supporting\ntags have to handle unknown tags gracefully. Clients especially need to\npreserve unknown tags when sending a completion item back to the server in\na resolve call.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "insertReplaceSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client support insert replace edit to control different behavior if a\ncompletion item is inserted in the text or should replace text.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "resolveSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily." - } - ] - } - }, - "optional": true, - "documentation": "Indicates which properties a client can resolve lazily on a completion\nitem. Before version 3.16.0 only the predefined properties `documentation`\nand `details` could be resolved lazily.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "insertTextModeSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "InsertTextMode" - } - } - } - ] - } - }, - "optional": true, - "documentation": "The client supports the `insertTextMode` property on\na completion item to override the whitespace handling mode\nas defined by the client (see `insertTextMode`).\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "labelDetailsSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for completion item label\ndetails (see also `CompletionItemLabelDetails`).\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } + "kind": "base", + "name": "uinteger" }, "optional": true, - "documentation": "The client supports the following `CompletionItem` specific\ncapabilities." + "documentation": "The maximum number of folding ranges that the client prefers to receive\nper document. The value serves as a hint, servers are free to follow the\nlimit." }, { - "name": "completionItemKind", + "name": "lineFoldingOnly", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItemKind" - } - }, - "optional": true, - "documentation": "The completion item kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe completion items kinds from `Text` to `Reference` as defined in\nthe initial version of the protocol." - } - ] - } + "kind": "base", + "name": "boolean" }, - "optional": true + "optional": true, + "documentation": "If set, the client signals that it only supports folding complete lines.\nIf set, client will ignore specified `startCharacter` and `endCharacter`\nproperties in a FoldingRange." }, { - "name": "insertTextMode", + "name": "foldingRangeKind", "type": { "kind": "reference", - "name": "InsertTextMode" + "name": "ClientFoldingRangeKindOptions" }, "optional": true, - "documentation": "Defines how the client handles whitespace and indentation\nwhen accepting a completion item that uses multi line\ntext in either `insertText` or `textEdit`.\n\n@since 3.17.0", + "documentation": "Specific options for the folding range kind.\n\n@since 3.17.0", "since": "3.17.0" }, { - "name": "contextSupport", + "name": "foldingRange", "type": { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "ClientFoldingRangeOptions" }, "optional": true, - "documentation": "The client supports to send additional context information for a\n`textDocument/completion` request." - }, + "documentation": "Specific options for the folding range.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + }, + { + "name": "SelectionRangeClientCapabilities", + "properties": [ { - "name": "completionList", + "name": "dynamicRegistration", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "itemDefaults", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "The client supports the following itemDefaults on\na completion list.\n\nThe value lists the supported property names of the\n`CompletionList.itemDefaults` object. If omitted\nno properties are supported.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } + "kind": "base", + "name": "boolean" }, "optional": true, - "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "Whether implementation supports dynamic registration for selection range providers. If this is set to `true`\nthe client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server\ncapability as well." } - ], - "documentation": "Completion client capabilities" + ] }, { - "name": "HoverClientCapabilities", + "name": "PublishDiagnosticsClientCapabilities", "properties": [ { - "name": "dynamicRegistration", + "name": "relatedInformation", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether hover supports dynamic registration." + "documentation": "Whether the clients accepts diagnostics with related information." }, { - "name": "contentFormat", + "name": "tagSupport", "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "MarkupKind" - } + "kind": "reference", + "name": "ClientDiagnosticsTagOptions" }, "optional": true, - "documentation": "Client supports the following content formats for the content\nproperty. The order describes the preferred format of the client." - } - ] - }, - { - "name": "SignatureHelpClientCapabilities", - "properties": [ + "documentation": "Client supports the tag property to provide meta data about a diagnostic.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.15.0", + "since": "3.15.0" + }, { - "name": "dynamicRegistration", + "name": "versionSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether signature help supports dynamic registration." + "documentation": "Whether the client interprets the version property of the\n`textDocument/publishDiagnostics` notification's parameter.\n\n@since 3.15.0", + "since": "3.15.0" }, { - "name": "signatureInformation", + "name": "codeDescriptionSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "documentationFormat", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "MarkupKind" - } - }, - "optional": true, - "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." - }, - { - "name": "parameterInformation", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "labelOffsetSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports processing label offsets instead of a\nsimple label string.\n\n@since 3.14.0", - "since": "3.14.0" - } - ] - } - }, - "optional": true, - "documentation": "Client capabilities specific to parameter information." - }, - { - "name": "activeParameterSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports the `activeParameter` property on `SignatureInformation`\nliteral.\n\n@since 3.16.0", - "since": "3.16.0" - } - ] - } + "kind": "base", + "name": "boolean" }, "optional": true, - "documentation": "The client supports the following `SignatureInformation`\nspecific properties." + "documentation": "Client supports a codeDescription property\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "contextSupport", + "name": "dataSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports to send additional context information for a\n`textDocument/signatureHelp` request. A client that opts into\ncontextSupport will also support the `retriggerCharacters` on\n`SignatureHelpOptions`.\n\n@since 3.15.0", - "since": "3.15.0" + "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/publishDiagnostics` and\n`textDocument/codeAction` request.\n\n@since 3.16.0", + "since": "3.16.0" } ], - "documentation": "Client Capabilities for a {@link SignatureHelpRequest}." + "documentation": "The publish diagnostic client capabilities." }, { - "name": "DeclarationClientCapabilities", + "name": "CallHierarchyClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11922,72 +12419,109 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether declaration supports dynamic registration. If this is set to `true`\nthe client supports the new `DeclarationRegistrationOptions` return value\nfor the corresponding server capability as well." - }, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensClientCapabilities", + "properties": [ { - "name": "linkSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports additional metadata in the form of declaration links." - } - ], - "documentation": "@since 3.14.0", - "since": "3.14.0" - }, - { - "name": "DefinitionClientCapabilities", - "properties": [ + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "requests", + "type": { + "kind": "reference", + "name": "ClientSemanticTokensRequestOptions" + }, + "documentation": "Which requests the client supports and might send to the server\ndepending on the server's capability. Please note that clients might not\nshow semantic tokens or degrade some of the user experience if a range\nor full request is advertised by the client but not provided by the\nserver. If for example the client capability `requests.full` and\n`request.range` are both set to true but the server only provides a\nrange provider the client might not render a minimap correctly or might\neven decide to not show any semantic tokens at all." + }, + { + "name": "tokenTypes", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token types that the client supports." + }, + { + "name": "tokenModifiers", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token modifiers that the client supports." + }, + { + "name": "formats", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TokenFormat" + } + }, + "documentation": "The token formats the clients supports." + }, { - "name": "dynamicRegistration", + "name": "overlappingTokenSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether definition supports dynamic registration." + "documentation": "Whether the client supports tokens that can overlap each other." }, { - "name": "linkSupport", + "name": "multilineTokenSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", - "since": "3.14.0" - } - ], - "documentation": "Client Capabilities for a {@link DefinitionRequest}." - }, - { - "name": "TypeDefinitionClientCapabilities", - "properties": [ + "documentation": "Whether the client supports tokens that can span multiple lines." + }, { - "name": "dynamicRegistration", + "name": "serverCancelSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `TypeDefinitionRegistrationOptions` return value\nfor the corresponding server capability as well." + "documentation": "Whether the client allows the server to actively cancel a\nsemantic token request, e.g. supports returning\nLSPErrorCodes.ServerCancelled. If a server does the client\nneeds to retrigger the request.\n\n@since 3.17.0", + "since": "3.17.0" }, { - "name": "linkSupport", + "name": "augmentsSyntaxTokens", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0" + "documentation": "Whether the client uses semantic tokens to augment existing\nsyntax tokens. If set to `true` client side created syntax\ntokens and semantic tokens are both used for colorization. If\nset to `false` the client only uses the returned semantic tokens\nfor colorization.\n\nIf the value is `undefined` then the client behavior is not\nspecified.\n\n@since 3.17.0", + "since": "3.17.0" } ], - "documentation": "Since 3.6.0" + "documentation": "@since 3.16.0", + "since": "3.16.0" }, { - "name": "ImplementationClientCapabilities", + "name": "LinkedEditingRangeClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -11996,24 +12530,30 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `ImplementationRegistrationOptions` return value\nfor the corresponding server capability as well." - }, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "Client capabilities for the linked editing range request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerClientCapabilities", + "properties": [ { - "name": "linkSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", - "since": "3.14.0" + "documentation": "Whether moniker supports dynamic registration. If this is set to `true`\nthe client supports the new `MonikerRegistrationOptions` return value\nfor the corresponding server capability as well." } ], - "documentation": "@since 3.6.0", - "since": "3.6.0" + "documentation": "Client capabilities specific to the moniker request.\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "ReferenceClientCapabilities", + "name": "TypeHierarchyClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -12022,13 +12562,14 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether references supports dynamic registration." + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." } ], - "documentation": "Client Capabilities for a {@link ReferencesRequest}." + "documentation": "@since 3.17.0", + "since": "3.17.0" }, { - "name": "DocumentHighlightClientCapabilities", + "name": "InlineValueClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -12037,13 +12578,14 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether document highlight supports dynamic registration." + "documentation": "Whether implementation supports dynamic registration for inline value providers." } ], - "documentation": "Client Capabilities for a {@link DocumentHighlightRequest}." + "documentation": "Client capabilities specific to inline values.\n\n@since 3.17.0", + "since": "3.17.0" }, { - "name": "DocumentSymbolClientCapabilities", + "name": "InlayHintClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -12052,80 +12594,48 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether document symbol supports dynamic registration." + "documentation": "Whether inlay hints support dynamic registration." }, { - "name": "symbolKind", + "name": "resolveSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolKind" - } - }, - "optional": true, - "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." - } - ] - } + "kind": "reference", + "name": "ClientInlayHintResolveOptions" }, "optional": true, - "documentation": "Specific capabilities for the `SymbolKind` in the\n`textDocument/documentSymbol` request." - }, + "documentation": "Indicates which properties a client can resolve lazily on an inlay\nhint." + } + ], + "documentation": "Inlay hint client capabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticClientCapabilities", + "properties": [ { - "name": "hierarchicalDocumentSymbolSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports hierarchical document symbols." - }, - { - "name": "tagSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } - }, - "optional": true, - "documentation": "The client supports tags on `SymbolInformation`. Tags are supported on\n`DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." }, { - "name": "labelSupport", + "name": "relatedDocumentSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "The client supports an additional label presented in the UI when\nregistering a document symbol provider.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "Whether the clients supports related documents for document diagnostic pulls." } ], - "documentation": "Client Capabilities for a {@link DocumentSymbolRequest}." + "documentation": "Client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", + "since": "3.17.0" }, { - "name": "CodeActionClientCapabilities", + "name": "InlineCompletionClientCapabilities", "properties": [ { "name": "dynamicRegistration", @@ -12134,529 +12644,479 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether code action supports dynamic registration." - }, - { - "name": "codeActionLiteralSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "codeActionKind", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CodeActionKind" - } - }, - "documentation": "The code action kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." - } - ] - } - }, - "documentation": "The code action kind is support with the following value\nset." - } - ] - } - }, - "optional": true, - "documentation": "The client support code action literals of type `CodeAction` as a valid\nresponse of the `textDocument/codeAction` request. If the property is not\nset the request can only return `Command` literals.\n\n@since 3.8.0", - "since": "3.8.0" - }, - { - "name": "isPreferredSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether code action supports the `isPreferred` property.\n\n@since 3.15.0", - "since": "3.15.0" - }, + "documentation": "Whether implementation supports dynamic registration for inline completion providers." + } + ], + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookDocumentSyncClientCapabilities", + "properties": [ { - "name": "disabledSupport", + "name": "dynamicRegistration", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether code action supports the `disabled` property.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "Whether implementation supports dynamic registration. If this is\nset to `true` the client supports the new\n`(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." }, { - "name": "dataSupport", + "name": "executionSummarySupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/codeAction` and a\n`codeAction/resolve` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, + "documentation": "The client supports sending execution summary data per cell." + } + ], + "documentation": "Notebook specific client capabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ShowMessageRequestClientCapabilities", + "properties": [ { - "name": "resolveSupport", + "name": "messageActionItem", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily." - } - ] - } + "kind": "reference", + "name": "ClientShowMessageActionItemOptions" }, "optional": true, - "documentation": "Whether the client supports resolving additional code action\nproperties via a separate `codeAction/resolve` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, + "documentation": "Capabilities specific to the `MessageActionItem` type." + } + ], + "documentation": "Show message request client capabilities" + }, + { + "name": "ShowDocumentClientCapabilities", + "properties": [ { - "name": "honorsChangeAnnotations", + "name": "support", "type": { "kind": "base", "name": "boolean" }, - "optional": true, - "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\n`CodeAction#edit` property by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "The client has support for the showDocument\nrequest." } ], - "documentation": "The Client Capabilities of a {@link CodeActionRequest}." + "documentation": "Client capabilities for the showDocument request.\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "CodeLensClientCapabilities", + "name": "StaleRequestSupportOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "cancel", "type": { "kind": "base", "name": "boolean" }, - "optional": true, - "documentation": "Whether code lens supports dynamic registration." + "documentation": "The client will actively cancel the request." + }, + { + "name": "retryOnContentModified", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The list of requests for which the client\nwill retry the request if it receives a\nresponse with error code `ContentModified`" } ], - "documentation": "The client capabilities of a {@link CodeLensRequest}." + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "DocumentLinkClientCapabilities", + "name": "RegularExpressionsClientCapabilities", "properties": [ { - "name": "dynamicRegistration", + "name": "engine", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, - "optional": true, - "documentation": "Whether document link supports dynamic registration." + "documentation": "The engine's name." }, { - "name": "tooltipSupport", + "name": "version", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, "optional": true, - "documentation": "Whether the client supports the `tooltip` property on `DocumentLink`.\n\n@since 3.15.0", - "since": "3.15.0" + "documentation": "The engine's version." } ], - "documentation": "The client capabilities of a {@link DocumentLinkRequest}." + "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "DocumentColorClientCapabilities", + "name": "MarkdownClientCapabilities", "properties": [ { - "name": "dynamicRegistration", + "name": "parser", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the parser." + }, + { + "name": "version", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `DocumentColorRegistrationOptions` return value\nfor the corresponding server capability as well." + "documentation": "The version of the parser." + }, + { + "name": "allowedTags", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "A list of HTML tags that the client allows / supports in\nMarkdown.\n\n@since 3.17.0", + "since": "3.17.0" } - ] + ], + "documentation": "Client capabilities specific to the used markdown parser.\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "DocumentFormattingClientCapabilities", + "name": "NotebookCellLanguage", "properties": [ { - "name": "dynamicRegistration", + "name": "language", "type": { "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether formatting supports dynamic registration." + "name": "string" + } } ], - "documentation": "Client capabilities of a {@link DocumentFormattingRequest}." + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "DocumentRangeFormattingClientCapabilities", + "name": "NotebookDocumentFilterNotebookType", "properties": [ { - "name": "dynamicRegistration", + "name": "notebookType", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, - "optional": true, - "documentation": "Whether range formatting supports dynamic registration." + "documentation": "The type of the enclosing notebook." }, { - "name": "rangesSupport", + "name": "scheme", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, "optional": true, - "documentation": "Whether the client supports formatting multiple ranges at once.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true - } - ], - "documentation": "Client capabilities of a {@link DocumentRangeFormattingRequest}." - }, - { - "name": "DocumentOnTypeFormattingClientCapabilities", - "properties": [ + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, { - "name": "dynamicRegistration", + "name": "pattern", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, "optional": true, - "documentation": "Whether on type formatting supports dynamic registration." + "documentation": "A glob pattern." } ], - "documentation": "Client capabilities of a {@link DocumentOnTypeFormattingRequest}." + "documentation": "A notebook document filter where `notebookType` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "RenameClientCapabilities", + "name": "NotebookDocumentFilterScheme", "properties": [ { - "name": "dynamicRegistration", + "name": "notebookType", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, "optional": true, - "documentation": "Whether rename supports dynamic registration." + "documentation": "The type of the enclosing notebook." }, { - "name": "prepareSupport", + "name": "scheme", "type": { "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports testing for validity of rename operations\nbefore execution.\n\n@since 3.12.0", - "since": "3.12.0" - }, - { - "name": "prepareSupportDefaultBehavior", - "type": { - "kind": "reference", - "name": "PrepareSupportDefaultBehavior" + "name": "string" }, - "optional": true, - "documentation": "Client supports the default behavior result.\n\nThe value indicates the default behavior used by the\nclient.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." }, { - "name": "honorsChangeAnnotations", + "name": "pattern", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, "optional": true, - "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\nrename request's workspace edit by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "A glob pattern." } - ] + ], + "documentation": "A notebook document filter where `scheme` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "FoldingRangeClientCapabilities", + "name": "NotebookDocumentFilterPattern", "properties": [ { - "name": "dynamicRegistration", + "name": "notebookType", "type": { "kind": "base", - "name": "boolean" + "name": "string" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration for folding range\nproviders. If this is set to `true` the client supports the new\n`FoldingRangeRegistrationOptions` return value for the corresponding\nserver capability as well." + "documentation": "The type of the enclosing notebook." }, { - "name": "rangeLimit", + "name": "scheme", "type": { "kind": "base", - "name": "uinteger" + "name": "string" }, "optional": true, - "documentation": "The maximum number of folding ranges that the client prefers to receive\nper document. The value serves as a hint, servers are free to follow the\nlimit." + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." }, { - "name": "lineFoldingOnly", + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A glob pattern." + } + ], + "documentation": "A notebook document filter where `pattern` is required field.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ChangeAnnotationsSupportOptions", + "properties": [ + { + "name": "groupsOnLabel", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "If set, the client signals that it only supports folding complete lines.\nIf set, client will ignore specified `startCharacter` and `endCharacter`\nproperties in a FoldingRange." - }, + "documentation": "Whether the client groups edits with equal labels into tree nodes,\nfor instance all edits labelled with \"Changes in Strings\" would\nbe a tree node." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ClientSymbolKindOptions", + "properties": [ { - "name": "foldingRangeKind", + "name": "valueSet", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FoldingRangeKind" - } - }, - "optional": true, - "documentation": "The folding range kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." - } - ] + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolKind" } }, "optional": true, - "documentation": "Specific options for the folding range kind.\n\n@since 3.17.0", - "since": "3.17.0" - }, + "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ClientSymbolTagOptions", + "properties": [ { - "name": "foldingRange", + "name": "valueSet", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "collapsedText", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "If set, the client signals that it supports setting collapsedText on\nfolding ranges to display custom labels instead of the default text.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" } }, - "optional": true, - "documentation": "Specific options for the folding range.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "The tags supported by the client." } - ] + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "SelectionRangeClientCapabilities", + "name": "ClientSymbolResolveOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "properties", "type": { - "kind": "base", - "name": "boolean" + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration for selection range providers. If this is set to `true`\nthe client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server\ncapability as well." + "documentation": "The properties that a client can resolve lazily. Usually\n`location.range`" } - ] + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "PublishDiagnosticsClientCapabilities", + "name": "ClientCompletionItemOptions", "properties": [ { - "name": "relatedInformation", + "name": "snippetSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the clients accepts diagnostics with related information." + "documentation": "Client supports snippets as insert text.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too." }, { - "name": "tagSupport", + "name": "commitCharactersSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DiagnosticTag" - } - }, - "documentation": "The tags supported by the client." - } - ] + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports commit characters on a completion item." + }, + { + "name": "documentationFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" } }, "optional": true, - "documentation": "Client supports the tag property to provide meta data about a diagnostic.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.15.0", - "since": "3.15.0" + "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." }, { - "name": "versionSupport", + "name": "deprecatedSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client interprets the version property of the\n`textDocument/publishDiagnostics` notification's parameter.\n\n@since 3.15.0", - "since": "3.15.0" + "documentation": "Client supports the deprecated property on a completion item." }, { - "name": "codeDescriptionSupport", + "name": "preselectSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Client supports a codeDescription property\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "Client supports the preselect property on a completion item." }, { - "name": "dataSupport", + "name": "tagSupport", + "type": { + "kind": "reference", + "name": "CompletionItemTagOptions" + }, + "optional": true, + "documentation": "Client supports the tag property on a completion item. Clients supporting\ntags have to handle unknown tags gracefully. Clients especially need to\npreserve unknown tags when sending a completion item back to the server in\na resolve call.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "insertReplaceSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/publishDiagnostics` and\n`textDocument/codeAction` request.\n\n@since 3.16.0", + "documentation": "Client support insert replace edit to control different behavior if a\ncompletion item is inserted in the text or should replace text.\n\n@since 3.16.0", "since": "3.16.0" - } - ], - "documentation": "The publish diagnostic client capabilities." - }, - { - "name": "CallHierarchyClientCapabilities", - "properties": [ + }, { - "name": "dynamicRegistration", + "name": "resolveSupport", "type": { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "ClientCompletionItemResolveOptions" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensClientCapabilities", - "properties": [ + "documentation": "Indicates which properties a client can resolve lazily on a completion\nitem. Before version 3.16.0 only the predefined properties `documentation`\nand `details` could be resolved lazily.\n\n@since 3.16.0", + "since": "3.16.0" + }, { - "name": "dynamicRegistration", + "name": "insertTextModeSupport", "type": { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "ClientCompletionItemInsertTextModeOptions" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + "documentation": "The client supports the `insertTextMode` property on\na completion item to override the whitespace handling mode\nas defined by the client (see `insertTextMode`).\n\n@since 3.16.0", + "since": "3.16.0" }, { - "name": "requests", + "name": "labelDetailsSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "range", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "literal", - "value": { - "properties": [] - } - } - ] - }, - "optional": true, - "documentation": "The client will send the `textDocument/semanticTokens/range` request if\nthe server provides a corresponding handler." - }, - { - "name": "full", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "delta", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client will send the `textDocument/semanticTokens/full/delta` request if\nthe server provides a corresponding handler." - } - ] - } - } - ] - }, - "optional": true, - "documentation": "The client will send the `textDocument/semanticTokens/full` request if\nthe server provides a corresponding handler." - } - ] - } + "kind": "base", + "name": "boolean" }, - "documentation": "Which requests the client supports and might send to the server\ndepending on the server's capability. Please note that clients might not\nshow semantic tokens or degrade some of the user experience if a range\nor full request is advertised by the client but not provided by the\nserver. If for example the client capability `requests.full` and\n`request.range` are both set to true but the server only provides a\nrange provider the client might not render a minimap correctly or might\neven decide to not show any semantic tokens at all." - }, + "optional": true, + "documentation": "The client has support for completion item label\ndetails (see also `CompletionItemLabelDetails`).\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ClientCompletionItemOptionsKind", + "properties": [ { - "name": "tokenTypes", + "name": "valueSet", "type": { "kind": "array", "element": { - "kind": "base", - "name": "string" + "kind": "reference", + "name": "CompletionItemKind" } }, - "documentation": "The token types that the client supports." - }, + "optional": true, + "documentation": "The completion item kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe completion items kinds from `Text` to `Reference` as defined in\nthe initial version of the protocol." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "CompletionListCapabilities", + "properties": [ { - "name": "tokenModifiers", + "name": "itemDefaults", "type": { "kind": "array", "element": { @@ -12664,333 +13124,336 @@ "name": "string" } }, - "documentation": "The token modifiers that the client supports." - }, + "optional": true, + "documentation": "The client supports the following itemDefaults on\na completion list.\n\nThe value lists the supported property names of the\n`CompletionList.itemDefaults` object. If omitted\nno properties are supported.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ClientSignatureInformationOptions", + "properties": [ { - "name": "formats", + "name": "documentationFormat", "type": { "kind": "array", "element": { "kind": "reference", - "name": "TokenFormat" + "name": "MarkupKind" } }, - "documentation": "The token formats the clients supports." - }, - { - "name": "overlappingTokenSupport", - "type": { - "kind": "base", - "name": "boolean" - }, "optional": true, - "documentation": "Whether the client supports tokens that can overlap each other." + "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." }, { - "name": "multilineTokenSupport", + "name": "parameterInformation", "type": { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "ClientSignatureParameterInformationOptions" }, "optional": true, - "documentation": "Whether the client supports tokens that can span multiple lines." + "documentation": "Client capabilities specific to parameter information." }, { - "name": "serverCancelSupport", + "name": "activeParameterSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether the client allows the server to actively cancel a\nsemantic token request, e.g. supports returning\nLSPErrorCodes.ServerCancelled. If a server does the client\nneeds to retrigger the request.\n\n@since 3.17.0", - "since": "3.17.0" - }, + "documentation": "The client supports the `activeParameter` property on `SignatureInformation`\nliteral.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ClientCodeActionLiteralOptions", + "properties": [ { - "name": "augmentsSyntaxTokens", + "name": "codeActionKind", "type": { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "ClientCodeActionKindOptions" }, - "optional": true, - "documentation": "Whether the client uses semantic tokens to augment existing\nsyntax tokens. If set to `true` client side created syntax\ntokens and semantic tokens are both used for colorization. If\nset to `false` the client only uses the returned semantic tokens\nfor colorization.\n\nIf the value is `undefined` then the client behavior is not\nspecified.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "The code action kind is support with the following value\nset." } ], - "documentation": "@since 3.16.0", - "since": "3.16.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "LinkedEditingRangeClientCapabilities", + "name": "ClientCodeActionResolveOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "properties", "type": { - "kind": "base", - "name": "boolean" + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + "documentation": "The properties that a client can resolve lazily." } ], - "documentation": "Client capabilities for the linked editing range request.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "MonikerClientCapabilities", + "name": "ClientFoldingRangeKindOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "valueSet", "type": { - "kind": "base", - "name": "boolean" + "kind": "array", + "element": { + "kind": "reference", + "name": "FoldingRangeKind" + } }, "optional": true, - "documentation": "Whether moniker supports dynamic registration. If this is set to `true`\nthe client supports the new `MonikerRegistrationOptions` return value\nfor the corresponding server capability as well." + "documentation": "The folding range kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." } ], - "documentation": "Client capabilities specific to the moniker request.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "TypeHierarchyClientCapabilities", + "name": "ClientFoldingRangeOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "collapsedText", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + "documentation": "If set, the client signals that it supports setting collapsedText on\nfolding ranges to display custom labels instead of the default text.\n\n@since 3.17.0", + "since": "3.17.0" } ], - "documentation": "@since 3.17.0", - "since": "3.17.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "InlineValueClientCapabilities", + "name": "ClientDiagnosticsTagOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "valueSet", "type": { - "kind": "base", - "name": "boolean" + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticTag" + } }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration for inline value providers." + "documentation": "The tags supported by the client." } ], - "documentation": "Client capabilities specific to inline values.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "InlayHintClientCapabilities", + "name": "ClientSemanticTokensRequestOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "range", "type": { - "kind": "base", - "name": "boolean" + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [] + } + } + ] }, "optional": true, - "documentation": "Whether inlay hints support dynamic registration." + "documentation": "The client will send the `textDocument/semanticTokens/range` request if\nthe server provides a corresponding handler." }, { - "name": "resolveSupport", + "name": "full", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily." - } - ] - } + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "ClientSemanticTokensRequestFullDelta" + } + ] }, "optional": true, - "documentation": "Indicates which properties a client can resolve lazily on an inlay\nhint." + "documentation": "The client will send the `textDocument/semanticTokens/full` request if\nthe server provides a corresponding handler." } ], - "documentation": "Inlay hint client capabilities.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "DiagnosticClientCapabilities", + "name": "ClientInlayHintResolveOptions", "properties": [ { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - }, - { - "name": "relatedDocumentSupport", + "name": "properties", "type": { - "kind": "base", - "name": "boolean" + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } }, - "optional": true, - "documentation": "Whether the clients supports related documents for document diagnostic pulls." + "documentation": "The properties that a client can resolve lazily." } ], - "documentation": "Client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "InlineCompletionClientCapabilities", + "name": "ClientShowMessageActionItemOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "additionalPropertiesSupport", "type": { "kind": "base", "name": "boolean" }, "optional": true, - "documentation": "Whether implementation supports dynamic registration for inline completion providers." + "documentation": "Whether the client supports additional attributes which\nare preserved and send back to the server in the\nrequest's response." } ], - "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "documentation": "@since 3.18.0\n@proposed", "since": "3.18.0", "proposed": true }, { - "name": "NotebookDocumentSyncClientCapabilities", + "name": "CompletionItemTagOptions", "properties": [ { - "name": "dynamicRegistration", + "name": "valueSet", "type": { - "kind": "base", - "name": "boolean" + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemTag" + } }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is\nset to `true` the client supports the new\n`(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - }, + "documentation": "The tags supported by the client." + } + ], + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ClientCompletionItemResolveOptions", + "properties": [ { - "name": "executionSummarySupport", + "name": "properties", "type": { - "kind": "base", - "name": "boolean" + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } }, - "optional": true, - "documentation": "The client supports sending execution summary data per cell." + "documentation": "The properties that a client can resolve lazily." } ], - "documentation": "Notebook specific client capabilities.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "ShowMessageRequestClientCapabilities", + "name": "ClientCompletionItemInsertTextModeOptions", "properties": [ { - "name": "messageActionItem", + "name": "valueSet", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "additionalPropertiesSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client supports additional attributes which\nare preserved and send back to the server in the\nrequest's response." - } - ] + "kind": "array", + "element": { + "kind": "reference", + "name": "InsertTextMode" } - }, - "optional": true, - "documentation": "Capabilities specific to the `MessageActionItem` type." + } } ], - "documentation": "Show message request client capabilities" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "ShowDocumentClientCapabilities", + "name": "ClientSignatureParameterInformationOptions", "properties": [ { - "name": "support", + "name": "labelOffsetSupport", "type": { "kind": "base", "name": "boolean" }, - "documentation": "The client has support for the showDocument\nrequest." + "optional": true, + "documentation": "The client supports processing label offsets instead of a\nsimple label string.\n\n@since 3.14.0", + "since": "3.14.0" } ], - "documentation": "Client capabilities for the showDocument request.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "RegularExpressionsClientCapabilities", + "name": "ClientCodeActionKindOptions", "properties": [ { - "name": "engine", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The engine's name." - }, - { - "name": "version", + "name": "valueSet", "type": { - "kind": "base", - "name": "string" + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKind" + } }, - "optional": true, - "documentation": "The engine's version." + "documentation": "The code action kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." } ], - "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true }, { - "name": "MarkdownClientCapabilities", + "name": "ClientSemanticTokensRequestFullDelta", "properties": [ { - "name": "parser", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of the parser." - }, - { - "name": "version", + "name": "delta", "type": { "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The version of the parser." - }, - { - "name": "allowedTags", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } + "name": "boolean" }, "optional": true, - "documentation": "A list of HTML tags that the client allows / supports in\nMarkdown.\n\n@since 3.17.0", - "since": "3.17.0" + "documentation": "The client will send the `textDocument/semanticTokens/full/delta` request if\nthe server provides a corresponding handler." } ], - "documentation": "Client capabilities specific to the used markdown parser.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true } ], "enumerations": [ @@ -14370,39 +14833,12 @@ "name": "Range" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - } - }, - { - "name": "placeholder", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } + "kind": "reference", + "name": "PrepareRenamePlaceholder" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "defaultBehavior", - "type": { - "kind": "base", - "name": "boolean" - } - } - ] - } + "kind": "reference", + "name": "PrepareRenameDefaultBehavior" } ] } @@ -14467,51 +14903,12 @@ "kind": "or", "items": [ { - "kind": "literal", - "value": { - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range of the document that changed." - }, - { - "name": "rangeLength", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The optional length of the range that got replaced.\n\n@deprecated use range instead." - }, - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The new text for the provided range." - } - ] - } + "kind": "reference", + "name": "TextDocumentContentChangePartial" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The new text of the whole document." - } - ] - } + "kind": "reference", + "name": "TextDocumentContentChangeWholeDocument" } ] }, @@ -14527,25 +14924,8 @@ "name": "string" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - }, - { - "name": "value", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } + "kind": "reference", + "name": "MarkedStringWithLanguage" } ] }, @@ -14610,226 +14990,52 @@ "kind": "or", "items": [ { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." - } - ] - } + "kind": "reference", + "name": "TextDocumentFilterLanguage" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." - } - ] - } + "kind": "reference", + "name": "TextDocumentFilterScheme" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." - } - ] - } + "kind": "reference", + "name": "TextDocumentFilterPattern" } ] }, "documentation": "A document filter denotes a document by different properties like\nthe {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of\nits resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.\n\nGlob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`\n@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "Pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@since 3.17.0", + "since": "3.17.0" + }, { "name": "NotebookDocumentFilter", "type": { "kind": "or", "items": [ { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterNotebookType" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterScheme" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A glob pattern." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterPattern" } ] }, "documentation": "A notebook document filter denotes a notebook document by\ndifferent properties. The properties will be match\nagainst the notebook's URI (same as with documents)\n\n@since 3.17.0", "since": "3.17.0" - }, - { - "name": "Pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@since 3.17.0", - "since": "3.17.0" } ] } diff --git a/packages/python/lsprotocol/types.py b/packages/python/lsprotocol/types.py index ffb923f..4485e28 100644 --- a/packages/python/lsprotocol/types.py +++ b/packages/python/lsprotocol/types.py @@ -9,7 +9,11 @@ import enum import functools +<<<<<<< HEAD from typing import Any, Dict, Optional, Sequence, Tuple, Union +======= +from typing import Any, Dict, List, Optional, Tuple, TypeAlias, Union +>>>>>>> 1a6f18e (vNext LSP) import attrs @@ -683,7 +687,7 @@ class LSPObject: by the client.""" -DefinitionLink = Union["LocationLink", "LocationLink"] +DefinitionLink = TypeAlias["LocationLink"] """Information about where a symbol is defined. Provides additional metadata over normal {@link Location location} definitions, including the range of @@ -710,7 +714,7 @@ class LSPObject: """The declaration of a symbol representation as one or many {@link Location locations}.""" -DeclarationLink = Union["LocationLink", "LocationLink"] +DeclarationLink = TypeAlias["LocationLink"] """Information about where a symbol is declared. Provides additional metadata over normal {@link Location location} declarations, including the range of @@ -746,20 +750,8 @@ class LSPObject: # Since: 3.17.0 -@attrs.define -class PrepareRenameResult_Type1: - range: "Range" = attrs.field() - - placeholder: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class PrepareRenameResult_Type2: - default_behavior: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - - PrepareRenameResult = Union[ - "Range", "PrepareRenameResult_Type1", "PrepareRenameResult_Type2" + "Range", "PrepareRenamePlaceholder", "PrepareRenameDefaultBehavior" ] @@ -789,43 +781,14 @@ class PrepareRenameResult_Type2: # Since: 3.17.0 -@attrs.define -class TextDocumentContentChangeEvent_Type1: - range: "Range" = attrs.field() - """The range of the document that changed.""" - - text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The new text for the provided range.""" - - range_length: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The optional length of the range that got replaced. - - @deprecated use range instead.""" - - -@attrs.define -class TextDocumentContentChangeEvent_Type2: - text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The new text of the whole document.""" - - TextDocumentContentChangeEvent = Union[ - "TextDocumentContentChangeEvent_Type1", "TextDocumentContentChangeEvent_Type2" + "TextDocumentContentChangePartial", "TextDocumentContentChangeWholeDocument" ] """An event describing a change to a text document. If only a text is provided it is considered to be the full content of the document.""" -@attrs.define -class MarkedString_Type1: - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - value: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -MarkedString = Union[str, "MarkedString_Type1"] +MarkedString = Union[str, "MarkedStringWithLanguage"] """MarkedString can be used to render human readable text. It is either a markdown string or a code-block that provides a language and a code snippet. The language identifier is semantically equal to the optional language identifier in fenced code blocks in GitHub @@ -855,62 +818,10 @@ class MarkedString_Type1: # Since: 3.17.0 -@attrs.define -class TextDocumentFilter_Type1: - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A language id, like `typescript`.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" - - -@attrs.define -class TextDocumentFilter_Type2: - scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - language: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A language id, like `typescript`.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" - - -@attrs.define -class TextDocumentFilter_Type3: - pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" - - language: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A language id, like `typescript`.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - TextDocumentFilter = Union[ - "TextDocumentFilter_Type1", "TextDocumentFilter_Type2", "TextDocumentFilter_Type3" + "TextDocumentFilterLanguage", + "TextDocumentFilterScheme", + "TextDocumentFilterPattern", ] """A document filter denotes a document by different properties like the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of @@ -931,73 +842,6 @@ class TextDocumentFilter_Type3: # Since: 3.17.0 -@attrs.define -class NotebookDocumentFilter_Type1: - notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The type of the enclosing notebook.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern.""" - - -@attrs.define -class NotebookDocumentFilter_Type2: - scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - notebook_type: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The type of the enclosing notebook.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern.""" - - -@attrs.define -class NotebookDocumentFilter_Type3: - pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A glob pattern.""" - - notebook_type: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The type of the enclosing notebook.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - -NotebookDocumentFilter = Union[ - "NotebookDocumentFilter_Type1", - "NotebookDocumentFilter_Type2", - "NotebookDocumentFilter_Type3", -] -"""A notebook document filter denotes a notebook document by -different properties. The properties will be match -against the notebook's URI (same as with documents) - -@since 3.17.0""" -# Since: 3.17.0 - - Pattern = str """The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: - `*` to match one or more characters in a path segment @@ -1011,6 +855,19 @@ class NotebookDocumentFilter_Type3: # Since: 3.17.0 +NotebookDocumentFilter = Union[ + "NotebookDocumentFilterNotebookType", + "NotebookDocumentFilterScheme", + "NotebookDocumentFilterPattern", +] +"""A notebook document filter denotes a notebook document by +different properties. The properties will be match +against the notebook's URI (same as with documents) + +@since 3.17.0""" +# Since: 3.17.0 + + @attrs.define class TextDocumentPositionParams: """A parameter literal used in requests to pass a text document and a position inside that @@ -1709,15 +1566,6 @@ class SemanticTokensPartialResult: data: Sequence[int] = attrs.field() -@attrs.define -class SemanticTokensOptionsFullType1: - delta: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server supports deltas for full documents.""" - - @attrs.define class SemanticTokensOptions: """@since 3.16.0""" @@ -1731,9 +1579,7 @@ class SemanticTokensOptions: """Server supports providing semantic tokens for a specific range of a document.""" - full: Optional[Union[bool, "SemanticTokensOptionsFullType1"]] = attrs.field( - default=None - ) + full: Optional[Union[bool, "SemanticTokensFullDelta"]] = attrs.field(default=None) """Server supports providing semantic tokens for a full document.""" work_done_progress: Optional[bool] = attrs.field( @@ -1742,15 +1588,6 @@ class SemanticTokensOptions: ) -@attrs.define -class SemanticTokensRegistrationOptionsFullType1: - delta: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server supports deltas for full documents.""" - - @attrs.define class SemanticTokensRegistrationOptions: """@since 3.16.0""" @@ -1770,9 +1607,7 @@ class SemanticTokensRegistrationOptions: """Server supports providing semantic tokens for a specific range of a document.""" - full: Optional[ - Union[bool, "SemanticTokensRegistrationOptionsFullType1"] - ] = attrs.field(default=None) + full: Optional[Union[bool, "SemanticTokensFullDelta"]] = attrs.field(default=None) """Server supports providing semantic tokens for a full document.""" work_done_progress: Optional[bool] = attrs.field( @@ -2822,18 +2657,6 @@ class UnregistrationParams: unregisterations: Sequence["Unregistration"] = attrs.field() -@attrs.define -class InitializeParamsClientInfoType: - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of the client as defined by the client.""" - - version: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The client's version as defined by the client.""" - - @attrs.define class _InitializeParams: """The initialize parameters""" @@ -2848,7 +2671,7 @@ class _InitializeParams: Is `null` if the process has not been started by another process. If the parent process is not alive then the server should exit.""" - client_info: Optional["InitializeParamsClientInfoType"] = attrs.field(default=None) + client_info: Optional["ClientInfo"] = attrs.field(default=None) """Information about the client @since 3.15.0""" @@ -2918,7 +2741,7 @@ class InitializeParams: Is `null` if the process has not been started by another process. If the parent process is not alive then the server should exit.""" - client_info: Optional["InitializeParamsClientInfoType"] = attrs.field(default=None) + client_info: Optional["ClientInfo"] = attrs.field(default=None) """Information about the client @since 3.15.0""" @@ -2973,18 +2796,6 @@ class InitializeParams: # Since: 3.6.0 -@attrs.define -class InitializeResultServerInfoType: - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of the server as defined by the server.""" - - version: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The server's version as defined by the server.""" - - @attrs.define class InitializeResult: """The result returned from an initialize request.""" @@ -2992,7 +2803,7 @@ class InitializeResult: capabilities: "ServerCapabilities" = attrs.field() """The capabilities the language server provides.""" - server_info: Optional["InitializeResultServerInfoType"] = attrs.field(default=None) + server_info: Optional["ServerInfo"] = attrs.field(default=None) """Information about the server. @since 3.15.0""" @@ -3417,6 +3228,7 @@ class CompletionItem: @attrs.define +<<<<<<< HEAD class CompletionListItemDefaultsTypeEditRangeType1: insert: "Range" = attrs.field() @@ -3459,6 +3271,8 @@ class CompletionListItemDefaultsType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class CompletionList: """Represents a collection of {@link CompletionItem completion items} to be presented in the editor.""" @@ -3472,9 +3286,7 @@ class CompletionList: items: Sequence[CompletionItem] = attrs.field() """The completion items.""" - item_defaults: Optional["CompletionListItemDefaultsType"] = attrs.field( - default=None - ) + item_defaults: Optional["CompletionItemDefaults"] = attrs.field(default=None) """In many cases the items of an actual completion result share the same value for properties like `commitCharacters` or the range of a text edit. A completion list can therefore define item defaults which will @@ -3491,20 +3303,6 @@ class CompletionList: # Since: 3.17.0 -@attrs.define -class CompletionOptionsCompletionItemType: - label_details_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server has support for completion item label - details (see also `CompletionItemLabelDetails`) when - receiving a completion item in a resolve call. - - @since 3.17.0""" - # Since: 3.17.0 - - @attrs.define class CompletionOptions: """Completion options.""" @@ -3537,9 +3335,7 @@ class CompletionOptions: """The server provides support to resolve additional information for a completion item.""" - completion_item: Optional["CompletionOptionsCompletionItemType"] = attrs.field( - default=None - ) + completion_item: Optional["ServerCompletionItemOptions"] = attrs.field(default=None) """The server supports the following `CompletionItem` specific capabilities. @@ -3552,20 +3348,6 @@ class CompletionOptions: ) -@attrs.define -class CompletionRegistrationOptionsCompletionItemType: - label_details_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server has support for completion item label - details (see also `CompletionItemLabelDetails`) when - receiving a completion item in a resolve call. - - @since 3.17.0""" - # Since: 3.17.0 - - @attrs.define class CompletionRegistrationOptions: """Registration options for a {@link CompletionRequest}.""" @@ -3604,9 +3386,7 @@ class CompletionRegistrationOptions: """The server provides support to resolve additional information for a completion item.""" - completion_item: Optional[ - "CompletionRegistrationOptionsCompletionItemType" - ] = attrs.field(default=None) + completion_item: Optional["ServerCompletionItemOptions"] = attrs.field(default=None) """The server supports the following `CompletionItem` specific capabilities. @@ -4144,14 +3924,6 @@ class Command: invoked with.""" -@attrs.define -class CodeActionDisabledType: - reason: str = attrs.field(validator=attrs.validators.instance_of(str)) - """Human readable description of why the code action is currently disabled. - - This is displayed in the code actions UI.""" - - @attrs.define class CodeAction: """A code action represents a change that can be performed in code, e.g. to fix a problem or @@ -4184,7 +3956,7 @@ class CodeAction: @since 3.15.0""" # Since: 3.15.0 - disabled: Optional["CodeActionDisabledType"] = attrs.field(default=None) + disabled: Optional["CodeActionDisabled"] = attrs.field(default=None) """Marks that the code action cannot currently be applied. Clients should follow the following guidelines regarding disabled code actions: @@ -4296,11 +4068,6 @@ class WorkspaceSymbolParams: the client.""" -@attrs.define -class WorkspaceSymbolLocationType1: - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - - @attrs.define class WorkspaceSymbol: """A special workspace symbol that supports locations without a range. @@ -4311,7 +4078,7 @@ class WorkspaceSymbol: # Since: 3.17.0 - location: Union[Location, "WorkspaceSymbolLocationType1"] = attrs.field() + location: Union[Location, "LocationUriOnly"] = attrs.field() """The location of the symbol. Whether a server is allowed to return a location without a range depends on the client capability `workspace.symbol.resolveSupport`. @@ -5708,6 +5475,7 @@ class VersionedNotebookDocumentIdentifier: @attrs.define +<<<<<<< HEAD class NotebookDocumentChangeEventCellsTypeStructureType: array: "NotebookCellArrayChange" = attrs.field() """The change to the cell array.""" @@ -5745,6 +5513,8 @@ class NotebookDocumentChangeEventCellsType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class NotebookDocumentChangeEvent: """A change event for a notebook document. @@ -5757,7 +5527,7 @@ class NotebookDocumentChangeEvent: Note: should always be an object literal (e.g. LSPObject)""" - cells: Optional["NotebookDocumentChangeEventCellsType"] = attrs.field(default=None) + cells: Optional["NotebookDocumentCellChanges"] = attrs.field(default=None) """Changes to cells""" @@ -5845,32 +5615,15 @@ class Unregistration: @attrs.define -class ServerCapabilitiesWorkspaceType: - workspace_folders: Optional["WorkspaceFoldersServerCapabilities"] = attrs.field( +class ServerCapabilities: + """Defines the capabilities provided by a language + server.""" + + position_encoding: Optional[Union[PositionEncodingKind, str]] = attrs.field( default=None ) - """The server supports workspace folder. - - @since 3.6.0""" - # Since: 3.6.0 - - file_operations: Optional["FileOperationOptions"] = attrs.field(default=None) - """The server is interested in notifications/requests for operations on files. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class ServerCapabilities: - """Defines the capabilities provided by a language - server.""" - - position_encoding: Optional[Union[PositionEncodingKind, str]] = attrs.field( - default=None - ) - """The position encoding the server picked from the encodings offered - by the client via the client capability `general.positionEncodings`. + """The position encoding the server picked from the encodings offered + by the client via the client capability `general.positionEncodings`. If the client didn't provide any position encodings the only valid value that a server can return is 'utf-16'. @@ -6071,13 +5824,34 @@ class ServerCapabilities: # Since: 3.18.0 # Proposed - workspace: Optional["ServerCapabilitiesWorkspaceType"] = attrs.field(default=None) + workspace: Optional["WorkspaceOptions"] = attrs.field(default=None) """Workspace specific server capabilities.""" experimental: Optional[LSPAny] = attrs.field(default=None) """Experimental server capabilities.""" +@attrs.define +class ServerInfo: + """Information about the server + + @since 3.15.0 + @since 3.18.0 ServerInfo type name added. + @proposed""" + + # Since: 3.18.0 ServerInfo type name added. + # Proposed + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of the server as defined by the server.""" + + version: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The server's version as defined by the server.""" + + @attrs.define class VersionedTextDocumentIdentifier: """A text document identifier to denote a specific version of a text document.""" @@ -6223,6 +5997,57 @@ class InsertReplaceEdit: """The range if the replace is requested.""" +@attrs.define +class CompletionItemDefaults: + """In many cases the items of an actual completion result share the same + value for properties like `commitCharacters` or the range of a text + edit. A completion list can therefore define item defaults which will + be used if a completion item itself doesn't specify the value. + + If a completion list specifies a default value and a completion item + also specifies a corresponding value the one from the item is used. + + Servers are only allowed to return default values if the client + signals support for this via the `completionList.itemDefaults` + capability. + + @since 3.17.0""" + + # Since: 3.17.0 + + commit_characters: Optional[List[str]] = attrs.field(default=None) + """A default commit character set. + + @since 3.17.0""" + # Since: 3.17.0 + + edit_range: Optional[Union[Range, "EditRangeWithInsertReplace"]] = attrs.field( + default=None + ) + """A default edit range. + + @since 3.17.0""" + # Since: 3.17.0 + + insert_text_format: Optional[InsertTextFormat] = attrs.field(default=None) + """A default insert text format. + + @since 3.17.0""" + # Since: 3.17.0 + + insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) + """A default insert text mode. + + @since 3.17.0""" + # Since: 3.17.0 + + data: Optional[LSPAny] = attrs.field(default=None) + """A default data value. + + @since 3.17.0""" + # Since: 3.17.0 + + @attrs.define class SignatureHelpContext: """Additional information about the context in which a signature help request was triggered. @@ -6319,6 +6144,35 @@ class CodeActionContext: # Since: 3.17.0 +@attrs.define +class CodeActionDisabled: + """Captures why the code action is currently disabled. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + reason: str = attrs.field(validator=attrs.validators.instance_of(str)) + """Human readable description of why the code action is currently disabled. + + This is displayed in the code actions UI.""" + + +@attrs.define +class LocationUriOnly: + """Location with only uri and does not include range. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + + @attrs.define class FormattingOptions: """Value-object describing what options formatting should use.""" @@ -6357,6 +6211,30 @@ class FormattingOptions: # Since: 3.15.0 +@attrs.define +class PrepareRenamePlaceholder: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + range: Range = attrs.field() + + placeholder: str = attrs.field(validator=attrs.validators.instance_of(str)) + + +@attrs.define +class PrepareRenameDefaultBehavior: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + default_behavior: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + + @attrs.define class SemanticTokensLegend: """@since 3.16.0""" @@ -6370,6 +6248,23 @@ class SemanticTokensLegend: """The token modifiers a server uses.""" +@attrs.define +class SemanticTokensFullDelta: + """Semantic tokens options to support deltas for full documents + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + delta: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server supports deltas for full documents.""" + + @attrs.define class OptionalVersionedTextDocumentIdentifier: """A text document identifier to optionally denote a specific version of a text document.""" @@ -6571,22 +6466,34 @@ class NotebookCell: @attrs.define -class NotebookCellArrayChange: - """A change describing how to move a `NotebookCell` - array from state S to S'. +class NotebookDocumentCellChanges: + """Cell changes to a notebook document. - @since 3.17.0""" + @since 3.18.0 + @proposed""" - # Since: 3.17.0 + # Since: 3.18.0 + # Proposed - start: int = attrs.field(validator=validators.uinteger_validator) - """The start oftest of the cell that changed.""" + structure: Optional["NotebookDocumentCellChangeStructure"] = attrs.field( + default=None + ) + """Changes to the cell structure to add or + remove cells.""" - delete_count: int = attrs.field(validator=validators.uinteger_validator) - """The deleted cells""" + data: Optional[List[NotebookCell]] = attrs.field(default=None) + """Changes to notebook cells properties like its + kind, execution summary or metadata.""" +<<<<<<< HEAD cells: Optional[Sequence[NotebookCell]] = attrs.field(default=None) """The new cells, if any""" +======= + text_content: Optional[List["NotebookDocumentCellContentChanges"]] = attrs.field( + default=None + ) + """Changes to the text content of notebook cells.""" +>>>>>>> 1a6f18e (vNext LSP) @attrs.define @@ -6606,6 +6513,27 @@ class SelectedCompletionInfo: """The text the range will be replaced with if this completion is accepted.""" +@attrs.define +class ClientInfo: + """Information about the client + + @since 3.15.0 + @since 3.18.0 ClientInfo type name added. + @proposed""" + + # Since: 3.18.0 ClientInfo type name added. + # Proposed + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of the client as defined by the client.""" + + version: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The client's version as defined by the client.""" + + @attrs.define class ClientCapabilities: """Defines the capabilities provided by the client.""" @@ -6672,6 +6600,7 @@ class TextDocumentSyncOptions: @attrs.define +<<<<<<< HEAD class NotebookDocumentSyncOptionsNotebookSelectorType1CellsType: language: str = attrs.field(validator=attrs.validators.instance_of(str)) @@ -6708,6 +6637,8 @@ class NotebookDocumentSyncOptionsNotebookSelectorType2: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class NotebookDocumentSyncOptions: """Options specific to a notebook plus its cells to be synced to the server. @@ -6725,11 +6656,16 @@ class NotebookDocumentSyncOptions: # Since: 3.17.0 +<<<<<<< HEAD notebook_selector: Sequence[ Union[ "NotebookDocumentSyncOptionsNotebookSelectorType1", "NotebookDocumentSyncOptionsNotebookSelectorType2", ] +======= + notebook_selector: List[ + Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] +>>>>>>> 1a6f18e (vNext LSP) ] = attrs.field() """The notebooks to be synced""" @@ -6742,6 +6678,7 @@ class NotebookDocumentSyncOptions: @attrs.define +<<<<<<< HEAD class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType: language: str = attrs.field(validator=attrs.validators.instance_of(str)) @@ -6780,6 +6717,8 @@ class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class NotebookDocumentSyncRegistrationOptions: """Registration options specific to a notebook. @@ -6787,11 +6726,16 @@ class NotebookDocumentSyncRegistrationOptions: # Since: 3.17.0 +<<<<<<< HEAD notebook_selector: Sequence[ Union[ "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1", "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2", ] +======= + notebook_selector: List[ + Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] +>>>>>>> 1a6f18e (vNext LSP) ] = attrs.field() """The notebooks to be synced""" @@ -6811,48 +6755,62 @@ class NotebookDocumentSyncRegistrationOptions: @attrs.define -class WorkspaceFoldersServerCapabilities: - supported: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, +class WorkspaceOptions: + """Defines workspace specific capabilities of the server. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + workspace_folders: Optional["WorkspaceFoldersServerCapabilities"] = attrs.field( + default=None ) - """The server has support for workspace folders""" + """The server supports workspace folder. + + @since 3.6.0""" + # Since: 3.6.0 - change_notifications: Optional[Union[str, bool]] = attrs.field(default=None) - """Whether the server wants to receive workspace folder - change notifications. + file_operations: Optional["FileOperationOptions"] = attrs.field(default=None) + """The server is interested in notifications/requests for operations on files. - If a string is provided the string is treated as an ID - under which the notification is registered on the client - side. The ID can be used to unregister for these events - using the `client/unregisterCapability` request.""" + @since 3.16.0""" + # Since: 3.16.0 @attrs.define -class FileOperationOptions: - """Options for notifications/requests for user operations on files. +class TextDocumentContentChangePartial: + """@since 3.18.0 + @proposed""" - @since 3.16.0""" + # Since: 3.18.0 + # Proposed - # Since: 3.16.0 + range: Range = attrs.field() + """The range of the document that changed.""" - did_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving didCreateFiles notifications.""" + text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The new text for the provided range.""" - will_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving willCreateFiles requests.""" + range_length: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The optional length of the range that got replaced. + + @deprecated use range instead.""" - did_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving didRenameFiles notifications.""" - will_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving willRenameFiles requests.""" +@attrs.define +class TextDocumentContentChangeWholeDocument: + """@since 3.18.0 + @proposed""" - did_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving didDeleteFiles file notifications.""" + # Since: 3.18.0 + # Proposed - will_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving willDeleteFiles file requests.""" + text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The new text of the whole document.""" @attrs.define @@ -6881,17 +6839,66 @@ class DiagnosticRelatedInformation: @attrs.define -class ParameterInformation: - """Represents a parameter of a callable-signature. A parameter can - have a label and a doc-comment.""" +class EditRangeWithInsertReplace: + """Edit range variant that includes ranges for insert and replace operations. - label: Union[str, Tuple[int, int]] = attrs.field() - """The label of this parameter information. - - Either a string or an inclusive start and exclusive end offsets within its containing - signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 - string representation as `Position` and `Range` does. - + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + insert: Range = attrs.field() + + replace: Range = attrs.field() + + +@attrs.define +class ServerCompletionItemOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + label_details_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server has support for completion item label + details (see also `CompletionItemLabelDetails`) when + receiving a completion item in a resolve call. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class MarkedStringWithLanguage: + """@since 3.18.0 + @proposed + @deprecated use MarkupContent instead.""" + + # Since: 3.18.0 + # Proposed + + language: str = attrs.field(validator=attrs.validators.instance_of(str)) + + value: str = attrs.field(validator=attrs.validators.instance_of(str)) + + +@attrs.define +class ParameterInformation: + """Represents a parameter of a callable-signature. A parameter can + have a label and a doc-comment.""" + + label: Union[str, Tuple[int, int]] = attrs.field() + """The label of this parameter information. + + Either a string or an inclusive start and exclusive end offsets within its containing + signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 + string representation as `Position` and `Range` does. + *Note*: a label of type string should be a substring of its containing signature label. Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.""" @@ -6955,6 +6962,41 @@ class ExecutionSummary: not if known by the client.""" +@attrs.define +class NotebookDocumentCellChangeStructure: + """Structural changes to cells in a notebook document. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + array: "NotebookCellArrayChange" = attrs.field() + """The change to the cell array.""" + + did_open: Optional[List[TextDocumentItem]] = attrs.field(default=None) + """Additional opened cell text documents.""" + + did_close: Optional[List[TextDocumentIdentifier]] = attrs.field(default=None) + """Additional closed cell text documents.""" + + +@attrs.define +class NotebookDocumentCellContentChanges: + """Content changes to a cell in a notebook document. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + document: VersionedTextDocumentIdentifier = attrs.field() + + changes: List[TextDocumentContentChangeEvent] = attrs.field() + + @attrs.define class WorkspaceClientCapabilities: """Workspace specific client capabilities.""" @@ -7305,6 +7347,7 @@ class WindowClientCapabilities: @attrs.define +<<<<<<< HEAD class GeneralClientCapabilitiesStaleRequestSupportType: cancel: bool = attrs.field(validator=attrs.validators.instance_of(bool)) """The client will actively cancel the request.""" @@ -7316,6 +7359,8 @@ class GeneralClientCapabilitiesStaleRequestSupportType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class GeneralClientCapabilities: """General client capabilities. @@ -7323,9 +7368,9 @@ class GeneralClientCapabilities: # Since: 3.16.0 - stale_request_support: Optional[ - "GeneralClientCapabilitiesStaleRequestSupportType" - ] = attrs.field(default=None) + stale_request_support: Optional["StaleRequestSupportOptions"] = attrs.field( + default=None + ) """Client capability that signals how the client handles stale requests (e.g. a request for which the client will not process the response @@ -7372,6 +7417,85 @@ class GeneralClientCapabilities: # Since: 3.17.0 +@attrs.define +class NotebookDocumentFilterWithNotebook: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + notebook: Union[str, NotebookDocumentFilter] = attrs.field() + """The notebook to be synced If a string + value is provided it matches against the + notebook type. '*' matches every notebook.""" + + cells: Optional[List["NotebookCellLanguage"]] = attrs.field(default=None) + """The cells of the matching notebook to be synced.""" + + +@attrs.define +class NotebookDocumentFilterWithCells: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + cells: List["NotebookCellLanguage"] = attrs.field() + """The cells of the matching notebook to be synced.""" + + notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) + """The notebook to be synced If a string + value is provided it matches against the + notebook type. '*' matches every notebook.""" + + +@attrs.define +class WorkspaceFoldersServerCapabilities: + supported: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server has support for workspace folders""" + + change_notifications: Optional[Union[str, bool]] = attrs.field(default=None) + """Whether the server wants to receive workspace folder + change notifications. + + If a string is provided the string is treated as an ID + under which the notification is registered on the client + side. The ID can be used to unregister for these events + using the `client/unregisterCapability` request.""" + + +@attrs.define +class FileOperationOptions: + """Options for notifications/requests for user operations on files. + + @since 3.16.0""" + + # Since: 3.16.0 + + did_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving didCreateFiles notifications.""" + + will_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving willCreateFiles requests.""" + + did_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving didRenameFiles notifications.""" + + will_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving willRenameFiles requests.""" + + did_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving didDeleteFiles file notifications.""" + + will_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving willDeleteFiles file requests.""" + + @attrs.define class RelativePattern: """A relative pattern is a helper to construct glob patterns that are matched @@ -7391,14 +7515,100 @@ class RelativePattern: @attrs.define -class WorkspaceEditClientCapabilitiesChangeAnnotationSupportType: - groups_on_label: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), +class TextDocumentFilterLanguage: + """A document filter where `language` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + language: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A language id, like `typescript`.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """Whether the client groups edits with equal labels into tree nodes, - for instance all edits labelled with "Changes in Strings" would - be a tree node.""" + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" + + +@attrs.define +class TextDocumentFilterScheme: + """A document filter where `scheme` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + language: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A language id, like `typescript`.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" + + +@attrs.define +class TextDocumentFilterPattern: + """A document filter where `pattern` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" + + language: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A language id, like `typescript`.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + +@attrs.define +class NotebookCellArrayChange: + """A change describing how to move a `NotebookCell` + array from state S to S'. + + @since 3.17.0""" + + # Since: 3.17.0 + + start: int = attrs.field(validator=validators.uinteger_validator) + """The start oftest of the cell that changed.""" + + delete_count: int = attrs.field(validator=validators.uinteger_validator) + """The deleted cells""" + + cells: Optional[List[NotebookCell]] = attrs.field(default=None) + """The new cells, if any""" @attrs.define @@ -7439,7 +7649,7 @@ class WorkspaceEditClientCapabilities: # Since: 3.16.0 change_annotation_support: Optional[ - "WorkspaceEditClientCapabilitiesChangeAnnotationSupportType" + "ChangeAnnotationsSupportOptions" ] = attrs.field(default=None) """Whether the client in general supports change annotations on text edits, create file, rename file and delete file changes. @@ -7479,6 +7689,7 @@ class DidChangeWatchedFilesClientCapabilities: @attrs.define +<<<<<<< HEAD class WorkspaceSymbolClientCapabilitiesSymbolKindType: value_set: Optional[Sequence[SymbolKind]] = attrs.field(default=None) """The symbol kind values the client supports. When this @@ -7505,6 +7716,8 @@ class WorkspaceSymbolClientCapabilitiesResolveSupportType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class WorkspaceSymbolClientCapabilities: """Client capabilities for a {@link WorkspaceSymbolRequest}.""" @@ -7514,23 +7727,17 @@ class WorkspaceSymbolClientCapabilities: ) """Symbol request supports dynamic registration.""" - symbol_kind: Optional[ - "WorkspaceSymbolClientCapabilitiesSymbolKindType" - ] = attrs.field(default=None) + symbol_kind: Optional["ClientSymbolKindOptions"] = attrs.field(default=None) """Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.""" - tag_support: Optional[ - "WorkspaceSymbolClientCapabilitiesTagSupportType" - ] = attrs.field(default=None) + tag_support: Optional["ClientSymbolTagOptions"] = attrs.field(default=None) """The client supports tags on `SymbolInformation`. Clients supporting tags have to handle unknown tags gracefully. @since 3.16.0""" # Since: 3.16.0 - resolve_support: Optional[ - "WorkspaceSymbolClientCapabilitiesResolveSupportType" - ] = attrs.field(default=None) + resolve_support: Optional["ClientSymbolResolveOptions"] = attrs.field(default=None) """The client support partial workspace symbols. The client will send the request `workspaceSymbol/resolve` to the server to resolve additional properties. @@ -7763,6 +7970,7 @@ class TextDocumentSyncClientCapabilities: @attrs.define +<<<<<<< HEAD class CompletionClientCapabilitiesCompletionItemTypeTagSupportType: value_set: Sequence[CompletionItemTag] = attrs.field() """The tags supported by the client.""" @@ -7894,6 +8102,8 @@ class CompletionClientCapabilitiesCompletionListType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class CompletionClientCapabilities: """Completion client capabilities""" @@ -7903,16 +8113,14 @@ class CompletionClientCapabilities: ) """Whether completion supports dynamic registration.""" - completion_item: Optional[ - "CompletionClientCapabilitiesCompletionItemType" - ] = attrs.field(default=None) + completion_item: Optional["ClientCompletionItemOptions"] = attrs.field(default=None) """The client supports the following `CompletionItem` specific capabilities.""" - completion_item_kind: Optional[ - "CompletionClientCapabilitiesCompletionItemKindType" - ] = attrs.field(default=None) - + completion_item_kind: Optional["ClientCompletionItemOptionsKind"] = attrs.field( + default=None + ) + insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) """Defines how the client handles whitespace and indentation when accepting a completion item that uses multi line @@ -7928,9 +8136,7 @@ class CompletionClientCapabilities: """The client supports to send additional context information for a `textDocument/completion` request.""" - completion_list: Optional[ - "CompletionClientCapabilitiesCompletionListType" - ] = attrs.field(default=None) + completion_list: Optional["CompletionListCapabilities"] = attrs.field(default=None) """The client supports the following `CompletionList` specific capabilities. @@ -7952,6 +8158,7 @@ class HoverClientCapabilities: @attrs.define +<<<<<<< HEAD class SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType: label_offset_support: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -7987,6 +8194,8 @@ class SignatureHelpClientCapabilitiesSignatureInformationType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class SignatureHelpClientCapabilities: """Client Capabilities for a {@link SignatureHelpRequest}.""" @@ -7996,9 +8205,9 @@ class SignatureHelpClientCapabilities: ) """Whether signature help supports dynamic registration.""" - signature_information: Optional[ - "SignatureHelpClientCapabilitiesSignatureInformationType" - ] = attrs.field(default=None) + signature_information: Optional["ClientSignatureInformationOptions"] = attrs.field( + default=None + ) """The client supports the following `SignatureInformation` specific properties.""" @@ -8124,6 +8333,7 @@ class DocumentHighlightClientCapabilities: @attrs.define +<<<<<<< HEAD class DocumentSymbolClientCapabilitiesSymbolKindType: value_set: Optional[Sequence[SymbolKind]] = attrs.field(default=None) """The symbol kind values the client supports. When this @@ -8143,6 +8353,8 @@ class DocumentSymbolClientCapabilitiesTagSupportType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class DocumentSymbolClientCapabilities: """Client Capabilities for a {@link DocumentSymbolRequest}.""" @@ -8152,9 +8364,7 @@ class DocumentSymbolClientCapabilities: ) """Whether document symbol supports dynamic registration.""" - symbol_kind: Optional[ - "DocumentSymbolClientCapabilitiesSymbolKindType" - ] = attrs.field(default=None) + symbol_kind: Optional["ClientSymbolKindOptions"] = attrs.field(default=None) """Specific capabilities for the `SymbolKind` in the `textDocument/documentSymbol` request.""" @@ -8164,9 +8374,7 @@ class DocumentSymbolClientCapabilities: ) """The client supports hierarchical document symbols.""" - tag_support: Optional[ - "DocumentSymbolClientCapabilitiesTagSupportType" - ] = attrs.field(default=None) + tag_support: Optional["ClientSymbolTagOptions"] = attrs.field(default=None) """The client supports tags on `SymbolInformation`. Tags are supported on `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. Clients supporting tags have to handle unknown tags gracefully. @@ -8186,6 +8394,7 @@ class DocumentSymbolClientCapabilities: @attrs.define +<<<<<<< HEAD class CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType: value_set: Sequence[Union[CodeActionKind, str]] = attrs.field() """The code action kind values the client supports. When this @@ -8210,6 +8419,8 @@ class CodeActionClientCapabilitiesResolveSupportType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class CodeActionClientCapabilities: """The Client Capabilities of a {@link CodeActionRequest}.""" @@ -8220,7 +8431,7 @@ class CodeActionClientCapabilities: """Whether code action supports dynamic registration.""" code_action_literal_support: Optional[ - "CodeActionClientCapabilitiesCodeActionLiteralSupportType" + "ClientCodeActionLiteralOptions" ] = attrs.field(default=None) """The client support code action literals of type `CodeAction` as a valid response of the `textDocument/codeAction` request. If the property is not @@ -8258,9 +8469,9 @@ class CodeActionClientCapabilities: @since 3.16.0""" # Since: 3.16.0 - resolve_support: Optional[ - "CodeActionClientCapabilitiesResolveSupportType" - ] = attrs.field(default=None) + resolve_support: Optional["ClientCodeActionResolveOptions"] = attrs.field( + default=None + ) """Whether the client supports resolving additional code action properties via a separate `codeAction/resolve` request. @@ -8411,6 +8622,7 @@ class RenameClientCapabilities: @attrs.define +<<<<<<< HEAD class FoldingRangeClientCapabilitiesFoldingRangeKindType: value_set: Optional[Sequence[Union[FoldingRangeKind, str]]] = attrs.field( default=None @@ -8435,6 +8647,8 @@ class FoldingRangeClientCapabilitiesFoldingRangeType: @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class FoldingRangeClientCapabilities: dynamic_registration: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -8460,17 +8674,15 @@ class FoldingRangeClientCapabilities: If set, client will ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.""" - folding_range_kind: Optional[ - "FoldingRangeClientCapabilitiesFoldingRangeKindType" - ] = attrs.field(default=None) + folding_range_kind: Optional["ClientFoldingRangeKindOptions"] = attrs.field( + default=None + ) """Specific options for the folding range kind. @since 3.17.0""" # Since: 3.17.0 - folding_range: Optional[ - "FoldingRangeClientCapabilitiesFoldingRangeType" - ] = attrs.field(default=None) + folding_range: Optional["ClientFoldingRangeOptions"] = attrs.field(default=None) """Specific options for the folding range. @since 3.17.0""" @@ -8489,12 +8701,15 @@ class SelectionRangeClientCapabilities: @attrs.define +<<<<<<< HEAD class PublishDiagnosticsClientCapabilitiesTagSupportType: value_set: Sequence[DiagnosticTag] = attrs.field() """The tags supported by the client.""" @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class PublishDiagnosticsClientCapabilities: """The publish diagnostic client capabilities.""" @@ -8504,9 +8719,7 @@ class PublishDiagnosticsClientCapabilities: ) """Whether the clients accepts diagnostics with related information.""" - tag_support: Optional[ - "PublishDiagnosticsClientCapabilitiesTagSupportType" - ] = attrs.field(default=None) + tag_support: Optional["ClientDiagnosticsTagOptions"] = attrs.field(default=None) """Client supports the tag property to provide meta data about a diagnostic. Clients supporting tags have to handle unknown tags gracefully. @@ -8559,36 +8772,13 @@ class CallHierarchyClientCapabilities: return value for the corresponding server capability as well.""" -@attrs.define -class SemanticTokensClientCapabilitiesRequestsTypeFullType1: - delta: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client will send the `textDocument/semanticTokens/full/delta` request if - the server provides a corresponding handler.""" - - -@attrs.define -class SemanticTokensClientCapabilitiesRequestsType: - range: Optional[Union[bool, Any]] = attrs.field(default=None) - """The client will send the `textDocument/semanticTokens/range` request if - the server provides a corresponding handler.""" - - full: Optional[ - Union[bool, "SemanticTokensClientCapabilitiesRequestsTypeFullType1"] - ] = attrs.field(default=None) - """The client will send the `textDocument/semanticTokens/full` request if - the server provides a corresponding handler.""" - - @attrs.define class SemanticTokensClientCapabilities: """@since 3.16.0""" # Since: 3.16.0 - requests: "SemanticTokensClientCapabilitiesRequestsType" = attrs.field() + requests: "ClientSemanticTokensRequestOptions" = attrs.field() """Which requests the client supports and might send to the server depending on the server's capability. Please note that clients might not show semantic tokens or degrade some of the user experience if a range @@ -8721,12 +8911,15 @@ class InlineValueClientCapabilities: @attrs.define +<<<<<<< HEAD class InlayHintClientCapabilitiesResolveSupportType: properties: Sequence[str] = attrs.field() """The properties that a client can resolve lazily.""" @attrs.define +======= +>>>>>>> 1a6f18e (vNext LSP) class InlayHintClientCapabilities: """Inlay hint client capabilities. @@ -8740,9 +8933,9 @@ class InlayHintClientCapabilities: ) """Whether inlay hints support dynamic registration.""" - resolve_support: Optional[ - "InlayHintClientCapabilitiesResolveSupportType" - ] = attrs.field(default=None) + resolve_support: Optional["ClientInlayHintResolveOptions"] = attrs.field( + default=None + ) """Indicates which properties a client can resolve lazily on an inlay hint.""" @@ -8811,24 +9004,13 @@ class NotebookDocumentSyncClientCapabilities: """The client supports sending execution summary data per cell.""" -@attrs.define -class ShowMessageRequestClientCapabilitiesMessageActionItemType: - additional_properties_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client supports additional attributes which - are preserved and send back to the server in the - request's response.""" - - @attrs.define class ShowMessageRequestClientCapabilities: """Show message request client capabilities""" - message_action_item: Optional[ - "ShowMessageRequestClientCapabilitiesMessageActionItemType" - ] = attrs.field(default=None) + message_action_item: Optional["ClientShowMessageActionItemOptions"] = attrs.field( + default=None + ) """Capabilities specific to the `MessageActionItem` type.""" @@ -8845,6 +9027,23 @@ class ShowDocumentClientCapabilities: request.""" +@attrs.define +class StaleRequestSupportOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + cancel: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """The client will actively cancel the request.""" + + retry_on_content_modified: List[str] = attrs.field() + """The list of requests for which the client + will retry the request if it receives a + response with error code `ContentModified`""" + + @attrs.define class RegularExpressionsClientCapabilities: """Client capabilities specific to regular expressions. @@ -8888,6 +9087,519 @@ class MarkdownClientCapabilities: # Since: 3.17.0 +@attrs.define +class NotebookCellLanguage: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + language: str = attrs.field(validator=attrs.validators.instance_of(str)) + + +@attrs.define +class NotebookDocumentFilterNotebookType: + """A notebook document filter where `notebookType` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The type of the enclosing notebook.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern.""" + + +@attrs.define +class NotebookDocumentFilterScheme: + """A notebook document filter where `scheme` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + notebook_type: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The type of the enclosing notebook.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern.""" + + +@attrs.define +class NotebookDocumentFilterPattern: + """A notebook document filter where `pattern` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A glob pattern.""" + + notebook_type: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The type of the enclosing notebook.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + +@attrs.define +class ChangeAnnotationsSupportOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + groups_on_label: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client groups edits with equal labels into tree nodes, + for instance all edits labelled with "Changes in Strings" would + be a tree node.""" + + +@attrs.define +class ClientSymbolKindOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Optional[List[SymbolKind]] = attrs.field(default=None) + """The symbol kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown. + + If this property is not present the client only supports + the symbol kinds from `File` to `Array` as defined in + the initial version of the protocol.""" + + +@attrs.define +class ClientSymbolTagOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: List[SymbolTag] = attrs.field() + """The tags supported by the client.""" + + +@attrs.define +class ClientSymbolResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: List[str] = attrs.field() + """The properties that a client can resolve lazily. Usually + `location.range`""" + + +@attrs.define +class ClientCompletionItemOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + snippet_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports snippets as insert text. + + A snippet can define tab stops and placeholders with `$1`, `$2` + and `${3:foo}`. `$0` defines the final tab stop, it defaults to + the end of the snippet. Placeholders with equal identifiers are linked, + that is typing in one will update others too.""" + + commit_characters_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports commit characters on a completion item.""" + + documentation_format: Optional[List[MarkupKind]] = attrs.field(default=None) + """Client supports the following content formats for the documentation + property. The order describes the preferred format of the client.""" + + deprecated_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports the deprecated property on a completion item.""" + + preselect_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports the preselect property on a completion item.""" + + tag_support: Optional["CompletionItemTagOptions"] = attrs.field(default=None) + """Client supports the tag property on a completion item. Clients supporting + tags have to handle unknown tags gracefully. Clients especially need to + preserve unknown tags when sending a completion item back to the server in + a resolve call. + + @since 3.15.0""" + # Since: 3.15.0 + + insert_replace_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client support insert replace edit to control different behavior if a + completion item is inserted in the text or should replace text. + + @since 3.16.0""" + # Since: 3.16.0 + + resolve_support: Optional["ClientCompletionItemResolveOptions"] = attrs.field( + default=None + ) + """Indicates which properties a client can resolve lazily on a completion + item. Before version 3.16.0 only the predefined properties `documentation` + and `details` could be resolved lazily. + + @since 3.16.0""" + # Since: 3.16.0 + + insert_text_mode_support: Optional[ + "ClientCompletionItemInsertTextModeOptions" + ] = attrs.field(default=None) + """The client supports the `insertTextMode` property on + a completion item to override the whitespace handling mode + as defined by the client (see `insertTextMode`). + + @since 3.16.0""" + # Since: 3.16.0 + + label_details_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for completion item label + details (see also `CompletionItemLabelDetails`). + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class ClientCompletionItemOptionsKind: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Optional[List[CompletionItemKind]] = attrs.field(default=None) + """The completion item kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown. + + If this property is not present the client only supports + the completion items kinds from `Text` to `Reference` as defined in + the initial version of the protocol.""" + + +@attrs.define +class CompletionListCapabilities: + """The client supports the following `CompletionList` specific + capabilities. + + @since 3.17.0""" + + # Since: 3.17.0 + + item_defaults: Optional[List[str]] = attrs.field(default=None) + """The client supports the following itemDefaults on + a completion list. + + The value lists the supported property names of the + `CompletionList.itemDefaults` object. If omitted + no properties are supported. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class ClientSignatureInformationOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + documentation_format: Optional[List[MarkupKind]] = attrs.field(default=None) + """Client supports the following content formats for the documentation + property. The order describes the preferred format of the client.""" + + parameter_information: Optional[ + "ClientSignatureParameterInformationOptions" + ] = attrs.field(default=None) + """Client capabilities specific to parameter information.""" + + active_parameter_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports the `activeParameter` property on `SignatureInformation` + literal. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class ClientCodeActionLiteralOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + code_action_kind: "ClientCodeActionKindOptions" = attrs.field() + """The code action kind is support with the following value + set.""" + + +@attrs.define +class ClientCodeActionResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: List[str] = attrs.field() + """The properties that a client can resolve lazily.""" + + +@attrs.define +class ClientFoldingRangeKindOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Optional[List[Union[FoldingRangeKind, str]]] = attrs.field(default=None) + """The folding range kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown.""" + + +@attrs.define +class ClientFoldingRangeOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + collapsed_text: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """If set, the client signals that it supports setting collapsedText on + folding ranges to display custom labels instead of the default text. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class ClientDiagnosticsTagOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: List[DiagnosticTag] = attrs.field() + """The tags supported by the client.""" + + +@attrs.define +class ClientSemanticTokensRequestOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + range: Optional[Union[bool, Any]] = attrs.field(default=None) + """The client will send the `textDocument/semanticTokens/range` request if + the server provides a corresponding handler.""" + + full: Optional[Union[bool, "ClientSemanticTokensRequestFullDelta"]] = attrs.field( + default=None + ) + """The client will send the `textDocument/semanticTokens/full` request if + the server provides a corresponding handler.""" + + +@attrs.define +class ClientInlayHintResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: List[str] = attrs.field() + """The properties that a client can resolve lazily.""" + + +@attrs.define +class ClientShowMessageActionItemOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + additional_properties_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client supports additional attributes which + are preserved and send back to the server in the + request's response.""" + + +@attrs.define +class CompletionItemTagOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: List[CompletionItemTag] = attrs.field() + """The tags supported by the client.""" + + +@attrs.define +class ClientCompletionItemResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: List[str] = attrs.field() + """The properties that a client can resolve lazily.""" + + +@attrs.define +class ClientCompletionItemInsertTextModeOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: List[InsertTextMode] = attrs.field() + + +@attrs.define +class ClientSignatureParameterInformationOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + label_offset_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports processing label offsets instead of a + simple label string. + + @since 3.14.0""" + # Since: 3.14.0 + + +@attrs.define +class ClientCodeActionKindOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: List[Union[CodeActionKind, str]] = attrs.field() + """The code action kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown.""" + + +@attrs.define +class ClientSemanticTokensRequestFullDelta: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + delta: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client will send the `textDocument/semanticTokens/full/delta` request if + the server provides a corresponding handler.""" + + @attrs.define class TextDocumentColorPresentationOptions: work_done_progress: Optional[bool] = attrs.field( @@ -12224,18 +12936,36 @@ def is_special_property(cls: type, property_name: str) -> bool: "CancelRequestNotification": CancelRequestNotification, "ChangeAnnotation": ChangeAnnotation, "ChangeAnnotationIdentifier": ChangeAnnotationIdentifier, + "ChangeAnnotationsSupportOptions": ChangeAnnotationsSupportOptions, "ClientCapabilities": ClientCapabilities, + "ClientCodeActionKindOptions": ClientCodeActionKindOptions, + "ClientCodeActionLiteralOptions": ClientCodeActionLiteralOptions, + "ClientCodeActionResolveOptions": ClientCodeActionResolveOptions, + "ClientCompletionItemInsertTextModeOptions": ClientCompletionItemInsertTextModeOptions, + "ClientCompletionItemOptions": ClientCompletionItemOptions, + "ClientCompletionItemOptionsKind": ClientCompletionItemOptionsKind, + "ClientCompletionItemResolveOptions": ClientCompletionItemResolveOptions, + "ClientDiagnosticsTagOptions": ClientDiagnosticsTagOptions, + "ClientFoldingRangeKindOptions": ClientFoldingRangeKindOptions, + "ClientFoldingRangeOptions": ClientFoldingRangeOptions, + "ClientInfo": ClientInfo, + "ClientInlayHintResolveOptions": ClientInlayHintResolveOptions, "ClientRegisterCapabilityRequest": ClientRegisterCapabilityRequest, "ClientRegisterCapabilityResponse": ClientRegisterCapabilityResponse, + "ClientSemanticTokensRequestFullDelta": ClientSemanticTokensRequestFullDelta, + "ClientSemanticTokensRequestOptions": ClientSemanticTokensRequestOptions, + "ClientShowMessageActionItemOptions": ClientShowMessageActionItemOptions, + "ClientSignatureInformationOptions": ClientSignatureInformationOptions, + "ClientSignatureParameterInformationOptions": ClientSignatureParameterInformationOptions, + "ClientSymbolKindOptions": ClientSymbolKindOptions, + "ClientSymbolResolveOptions": ClientSymbolResolveOptions, + "ClientSymbolTagOptions": ClientSymbolTagOptions, "ClientUnregisterCapabilityRequest": ClientUnregisterCapabilityRequest, "ClientUnregisterCapabilityResponse": ClientUnregisterCapabilityResponse, "CodeAction": CodeAction, "CodeActionClientCapabilities": CodeActionClientCapabilities, - "CodeActionClientCapabilitiesCodeActionLiteralSupportType": CodeActionClientCapabilitiesCodeActionLiteralSupportType, - "CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType": CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType, - "CodeActionClientCapabilitiesResolveSupportType": CodeActionClientCapabilitiesResolveSupportType, "CodeActionContext": CodeActionContext, - "CodeActionDisabledType": CodeActionDisabledType, + "CodeActionDisabled": CodeActionDisabled, "CodeActionKind": CodeActionKind, "CodeActionOptions": CodeActionOptions, "CodeActionParams": CodeActionParams, @@ -12258,27 +12988,20 @@ def is_special_property(cls: type, property_name: str) -> bool: "ColorPresentationParams": ColorPresentationParams, "Command": Command, "CompletionClientCapabilities": CompletionClientCapabilities, - "CompletionClientCapabilitiesCompletionItemKindType": CompletionClientCapabilitiesCompletionItemKindType, - "CompletionClientCapabilitiesCompletionItemType": CompletionClientCapabilitiesCompletionItemType, - "CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType": CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType, - "CompletionClientCapabilitiesCompletionItemTypeResolveSupportType": CompletionClientCapabilitiesCompletionItemTypeResolveSupportType, - "CompletionClientCapabilitiesCompletionItemTypeTagSupportType": CompletionClientCapabilitiesCompletionItemTypeTagSupportType, - "CompletionClientCapabilitiesCompletionListType": CompletionClientCapabilitiesCompletionListType, "CompletionContext": CompletionContext, "CompletionItem": CompletionItem, + "CompletionItemDefaults": CompletionItemDefaults, "CompletionItemKind": CompletionItemKind, "CompletionItemLabelDetails": CompletionItemLabelDetails, "CompletionItemResolveRequest": CompletionItemResolveRequest, "CompletionItemResolveResponse": CompletionItemResolveResponse, "CompletionItemTag": CompletionItemTag, + "CompletionItemTagOptions": CompletionItemTagOptions, "CompletionList": CompletionList, - "CompletionListItemDefaultsType": CompletionListItemDefaultsType, - "CompletionListItemDefaultsTypeEditRangeType1": CompletionListItemDefaultsTypeEditRangeType1, + "CompletionListCapabilities": CompletionListCapabilities, "CompletionOptions": CompletionOptions, - "CompletionOptionsCompletionItemType": CompletionOptionsCompletionItemType, "CompletionParams": CompletionParams, "CompletionRegistrationOptions": CompletionRegistrationOptions, - "CompletionRegistrationOptionsCompletionItemType": CompletionRegistrationOptionsCompletionItemType, "CompletionTriggerKind": CompletionTriggerKind, "ConfigurationItem": ConfigurationItem, "ConfigurationParams": ConfigurationParams, @@ -12362,11 +13085,10 @@ def is_special_property(cls: type, property_name: str) -> bool: "DocumentSelector": DocumentSelector, "DocumentSymbol": DocumentSymbol, "DocumentSymbolClientCapabilities": DocumentSymbolClientCapabilities, - "DocumentSymbolClientCapabilitiesSymbolKindType": DocumentSymbolClientCapabilitiesSymbolKindType, - "DocumentSymbolClientCapabilitiesTagSupportType": DocumentSymbolClientCapabilitiesTagSupportType, "DocumentSymbolOptions": DocumentSymbolOptions, "DocumentSymbolParams": DocumentSymbolParams, "DocumentSymbolRegistrationOptions": DocumentSymbolRegistrationOptions, + "EditRangeWithInsertReplace": EditRangeWithInsertReplace, "ErrorCodes": ErrorCodes, "ExecuteCommandClientCapabilities": ExecuteCommandClientCapabilities, "ExecuteCommandOptions": ExecuteCommandOptions, @@ -12390,8 +13112,6 @@ def is_special_property(cls: type, property_name: str) -> bool: "FileSystemWatcher": FileSystemWatcher, "FoldingRange": FoldingRange, "FoldingRangeClientCapabilities": FoldingRangeClientCapabilities, - "FoldingRangeClientCapabilitiesFoldingRangeKindType": FoldingRangeClientCapabilitiesFoldingRangeKindType, - "FoldingRangeClientCapabilitiesFoldingRangeType": FoldingRangeClientCapabilitiesFoldingRangeType, "FoldingRangeKind": FoldingRangeKind, "FoldingRangeOptions": FoldingRangeOptions, "FoldingRangeParams": FoldingRangeParams, @@ -12400,7 +13120,6 @@ def is_special_property(cls: type, property_name: str) -> bool: "FormattingOptions": FormattingOptions, "FullDocumentDiagnosticReport": FullDocumentDiagnosticReport, "GeneralClientCapabilities": GeneralClientCapabilities, - "GeneralClientCapabilitiesStaleRequestSupportType": GeneralClientCapabilitiesStaleRequestSupportType, "GlobPattern": GlobPattern, "Hover": Hover, "HoverClientCapabilities": HoverClientCapabilities, @@ -12413,16 +13132,13 @@ def is_special_property(cls: type, property_name: str) -> bool: "ImplementationRegistrationOptions": ImplementationRegistrationOptions, "InitializeError": InitializeError, "InitializeParams": InitializeParams, - "InitializeParamsClientInfoType": InitializeParamsClientInfoType, "InitializeRequest": InitializeRequest, "InitializeResponse": InitializeResponse, "InitializeResult": InitializeResult, - "InitializeResultServerInfoType": InitializeResultServerInfoType, "InitializedNotification": InitializedNotification, "InitializedParams": InitializedParams, "InlayHint": InlayHint, "InlayHintClientCapabilities": InlayHintClientCapabilities, - "InlayHintClientCapabilitiesResolveSupportType": InlayHintClientCapabilitiesResolveSupportType, "InlayHintKind": InlayHintKind, "InlayHintLabelPart": InlayHintLabelPart, "InlayHintOptions": InlayHintOptions, @@ -12463,12 +13179,13 @@ def is_special_property(cls: type, property_name: str) -> bool: "LinkedEditingRanges": LinkedEditingRanges, "Location": Location, "LocationLink": LocationLink, + "LocationUriOnly": LocationUriOnly, "LogMessageParams": LogMessageParams, "LogTraceNotification": LogTraceNotification, "LogTraceParams": LogTraceParams, "MarkdownClientCapabilities": MarkdownClientCapabilities, "MarkedString": MarkedString, - "MarkedString_Type1": MarkedString_Type1, + "MarkedStringWithLanguage": MarkedStringWithLanguage, "MarkupContent": MarkupContent, "MarkupKind": MarkupKind, "MessageActionItem": MessageActionItem, @@ -12483,50 +13200,44 @@ def is_special_property(cls: type, property_name: str) -> bool: "NotebookCell": NotebookCell, "NotebookCellArrayChange": NotebookCellArrayChange, "NotebookCellKind": NotebookCellKind, + "NotebookCellLanguage": NotebookCellLanguage, "NotebookCellTextDocumentFilter": NotebookCellTextDocumentFilter, "NotebookDocument": NotebookDocument, + "NotebookDocumentCellChangeStructure": NotebookDocumentCellChangeStructure, + "NotebookDocumentCellChanges": NotebookDocumentCellChanges, + "NotebookDocumentCellContentChanges": NotebookDocumentCellContentChanges, "NotebookDocumentChangeEvent": NotebookDocumentChangeEvent, - "NotebookDocumentChangeEventCellsType": NotebookDocumentChangeEventCellsType, - "NotebookDocumentChangeEventCellsTypeStructureType": NotebookDocumentChangeEventCellsTypeStructureType, - "NotebookDocumentChangeEventCellsTypeTextContentType": NotebookDocumentChangeEventCellsTypeTextContentType, "NotebookDocumentClientCapabilities": NotebookDocumentClientCapabilities, "NotebookDocumentDidChangeNotification": NotebookDocumentDidChangeNotification, "NotebookDocumentDidCloseNotification": NotebookDocumentDidCloseNotification, "NotebookDocumentDidOpenNotification": NotebookDocumentDidOpenNotification, "NotebookDocumentDidSaveNotification": NotebookDocumentDidSaveNotification, "NotebookDocumentFilter": NotebookDocumentFilter, - "NotebookDocumentFilter_Type1": NotebookDocumentFilter_Type1, - "NotebookDocumentFilter_Type2": NotebookDocumentFilter_Type2, - "NotebookDocumentFilter_Type3": NotebookDocumentFilter_Type3, + "NotebookDocumentFilterNotebookType": NotebookDocumentFilterNotebookType, + "NotebookDocumentFilterPattern": NotebookDocumentFilterPattern, + "NotebookDocumentFilterScheme": NotebookDocumentFilterScheme, + "NotebookDocumentFilterWithCells": NotebookDocumentFilterWithCells, + "NotebookDocumentFilterWithNotebook": NotebookDocumentFilterWithNotebook, "NotebookDocumentIdentifier": NotebookDocumentIdentifier, "NotebookDocumentSyncClientCapabilities": NotebookDocumentSyncClientCapabilities, "NotebookDocumentSyncOptions": NotebookDocumentSyncOptions, - "NotebookDocumentSyncOptionsNotebookSelectorType1": NotebookDocumentSyncOptionsNotebookSelectorType1, - "NotebookDocumentSyncOptionsNotebookSelectorType1CellsType": NotebookDocumentSyncOptionsNotebookSelectorType1CellsType, - "NotebookDocumentSyncOptionsNotebookSelectorType2": NotebookDocumentSyncOptionsNotebookSelectorType2, - "NotebookDocumentSyncOptionsNotebookSelectorType2CellsType": NotebookDocumentSyncOptionsNotebookSelectorType2CellsType, "NotebookDocumentSyncRegistrationOptions": NotebookDocumentSyncRegistrationOptions, - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1": NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1, - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType": NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType, - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2": NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2, - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType": NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType, "OptionalVersionedTextDocumentIdentifier": OptionalVersionedTextDocumentIdentifier, "ParameterInformation": ParameterInformation, "PartialResultParams": PartialResultParams, "Pattern": Pattern, "Position": Position, "PositionEncodingKind": PositionEncodingKind, + "PrepareRenameDefaultBehavior": PrepareRenameDefaultBehavior, "PrepareRenameParams": PrepareRenameParams, + "PrepareRenamePlaceholder": PrepareRenamePlaceholder, "PrepareRenameResult": PrepareRenameResult, - "PrepareRenameResult_Type1": PrepareRenameResult_Type1, - "PrepareRenameResult_Type2": PrepareRenameResult_Type2, "PrepareSupportDefaultBehavior": PrepareSupportDefaultBehavior, "PreviousResultId": PreviousResultId, "ProgressNotification": ProgressNotification, "ProgressParams": ProgressParams, "ProgressToken": ProgressToken, "PublishDiagnosticsClientCapabilities": PublishDiagnosticsClientCapabilities, - "PublishDiagnosticsClientCapabilitiesTagSupportType": PublishDiagnosticsClientCapabilitiesTagSupportType, "PublishDiagnosticsParams": PublishDiagnosticsParams, "Range": Range, "ReferenceClientCapabilities": ReferenceClientCapabilities, @@ -12562,23 +13273,21 @@ def is_special_property(cls: type, property_name: str) -> bool: "SemanticTokenTypes": SemanticTokenTypes, "SemanticTokens": SemanticTokens, "SemanticTokensClientCapabilities": SemanticTokensClientCapabilities, - "SemanticTokensClientCapabilitiesRequestsType": SemanticTokensClientCapabilitiesRequestsType, - "SemanticTokensClientCapabilitiesRequestsTypeFullType1": SemanticTokensClientCapabilitiesRequestsTypeFullType1, "SemanticTokensDelta": SemanticTokensDelta, "SemanticTokensDeltaParams": SemanticTokensDeltaParams, "SemanticTokensDeltaPartialResult": SemanticTokensDeltaPartialResult, "SemanticTokensEdit": SemanticTokensEdit, + "SemanticTokensFullDelta": SemanticTokensFullDelta, "SemanticTokensLegend": SemanticTokensLegend, "SemanticTokensOptions": SemanticTokensOptions, - "SemanticTokensOptionsFullType1": SemanticTokensOptionsFullType1, "SemanticTokensParams": SemanticTokensParams, "SemanticTokensPartialResult": SemanticTokensPartialResult, "SemanticTokensRangeParams": SemanticTokensRangeParams, "SemanticTokensRegistrationOptions": SemanticTokensRegistrationOptions, - "SemanticTokensRegistrationOptionsFullType1": SemanticTokensRegistrationOptionsFullType1, "SemanticTokensWorkspaceClientCapabilities": SemanticTokensWorkspaceClientCapabilities, "ServerCapabilities": ServerCapabilities, - "ServerCapabilitiesWorkspaceType": ServerCapabilitiesWorkspaceType, + "ServerCompletionItemOptions": ServerCompletionItemOptions, + "ServerInfo": ServerInfo, "SetTraceNotification": SetTraceNotification, "SetTraceParams": SetTraceParams, "ShowDocumentClientCapabilities": ShowDocumentClientCapabilities, @@ -12586,20 +13295,18 @@ def is_special_property(cls: type, property_name: str) -> bool: "ShowDocumentResult": ShowDocumentResult, "ShowMessageParams": ShowMessageParams, "ShowMessageRequestClientCapabilities": ShowMessageRequestClientCapabilities, - "ShowMessageRequestClientCapabilitiesMessageActionItemType": ShowMessageRequestClientCapabilitiesMessageActionItemType, "ShowMessageRequestParams": ShowMessageRequestParams, "ShutdownRequest": ShutdownRequest, "ShutdownResponse": ShutdownResponse, "SignatureHelp": SignatureHelp, "SignatureHelpClientCapabilities": SignatureHelpClientCapabilities, - "SignatureHelpClientCapabilitiesSignatureInformationType": SignatureHelpClientCapabilitiesSignatureInformationType, - "SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType": SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType, "SignatureHelpContext": SignatureHelpContext, "SignatureHelpOptions": SignatureHelpOptions, "SignatureHelpParams": SignatureHelpParams, "SignatureHelpRegistrationOptions": SignatureHelpRegistrationOptions, "SignatureHelpTriggerKind": SignatureHelpTriggerKind, "SignatureInformation": SignatureInformation, + "StaleRequestSupportOptions": StaleRequestSupportOptions, "StaticRegistrationOptions": StaticRegistrationOptions, "StringValue": StringValue, "SymbolInformation": SymbolInformation, @@ -12618,8 +13325,8 @@ def is_special_property(cls: type, property_name: str) -> bool: "TextDocumentCompletionRequest": TextDocumentCompletionRequest, "TextDocumentCompletionResponse": TextDocumentCompletionResponse, "TextDocumentContentChangeEvent": TextDocumentContentChangeEvent, - "TextDocumentContentChangeEvent_Type1": TextDocumentContentChangeEvent_Type1, - "TextDocumentContentChangeEvent_Type2": TextDocumentContentChangeEvent_Type2, + "TextDocumentContentChangePartial": TextDocumentContentChangePartial, + "TextDocumentContentChangeWholeDocument": TextDocumentContentChangeWholeDocument, "TextDocumentDeclarationRequest": TextDocumentDeclarationRequest, "TextDocumentDeclarationResponse": TextDocumentDeclarationResponse, "TextDocumentDefinitionRequest": TextDocumentDefinitionRequest, @@ -12640,9 +13347,9 @@ def is_special_property(cls: type, property_name: str) -> bool: "TextDocumentDocumentSymbolResponse": TextDocumentDocumentSymbolResponse, "TextDocumentEdit": TextDocumentEdit, "TextDocumentFilter": TextDocumentFilter, - "TextDocumentFilter_Type1": TextDocumentFilter_Type1, - "TextDocumentFilter_Type2": TextDocumentFilter_Type2, - "TextDocumentFilter_Type3": TextDocumentFilter_Type3, + "TextDocumentFilterLanguage": TextDocumentFilterLanguage, + "TextDocumentFilterPattern": TextDocumentFilterPattern, + "TextDocumentFilterScheme": TextDocumentFilterScheme, "TextDocumentFoldingRangeRequest": TextDocumentFoldingRangeRequest, "TextDocumentFoldingRangeResponse": TextDocumentFoldingRangeResponse, "TextDocumentFormattingRequest": TextDocumentFormattingRequest, @@ -12769,7 +13476,6 @@ def is_special_property(cls: type, property_name: str) -> bool: "WorkspaceDocumentDiagnosticReport": WorkspaceDocumentDiagnosticReport, "WorkspaceEdit": WorkspaceEdit, "WorkspaceEditClientCapabilities": WorkspaceEditClientCapabilities, - "WorkspaceEditClientCapabilitiesChangeAnnotationSupportType": WorkspaceEditClientCapabilitiesChangeAnnotationSupportType, "WorkspaceExecuteCommandRequest": WorkspaceExecuteCommandRequest, "WorkspaceExecuteCommandResponse": WorkspaceExecuteCommandResponse, "WorkspaceFolder": WorkspaceFolder, @@ -12783,14 +13489,11 @@ def is_special_property(cls: type, property_name: str) -> bool: "WorkspaceInlayHintRefreshResponse": WorkspaceInlayHintRefreshResponse, "WorkspaceInlineValueRefreshRequest": WorkspaceInlineValueRefreshRequest, "WorkspaceInlineValueRefreshResponse": WorkspaceInlineValueRefreshResponse, + "WorkspaceOptions": WorkspaceOptions, "WorkspaceSemanticTokensRefreshRequest": WorkspaceSemanticTokensRefreshRequest, "WorkspaceSemanticTokensRefreshResponse": WorkspaceSemanticTokensRefreshResponse, "WorkspaceSymbol": WorkspaceSymbol, "WorkspaceSymbolClientCapabilities": WorkspaceSymbolClientCapabilities, - "WorkspaceSymbolClientCapabilitiesResolveSupportType": WorkspaceSymbolClientCapabilitiesResolveSupportType, - "WorkspaceSymbolClientCapabilitiesSymbolKindType": WorkspaceSymbolClientCapabilitiesSymbolKindType, - "WorkspaceSymbolClientCapabilitiesTagSupportType": WorkspaceSymbolClientCapabilitiesTagSupportType, - "WorkspaceSymbolLocationType1": WorkspaceSymbolLocationType1, "WorkspaceSymbolOptions": WorkspaceSymbolOptions, "WorkspaceSymbolParams": WorkspaceSymbolParams, "WorkspaceSymbolRegistrationOptions": WorkspaceSymbolRegistrationOptions, diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index 231c462..81af676 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -1902,26 +1902,12 @@ pub enum DocumentDiagnosticReport { Unchanged(RelatedUnchangedDocumentDiagnosticReport), } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructPrepareRenameResult { - pub range: Range, - - pub placeholder: String, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructPrepareRenameResultDefault { - pub default_behavior: bool, -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(untagged)] pub enum PrepareRenameResult { Range(Range), - Placeholder(StructPrepareRenameResult), - Default(StructPrepareRenameResultDefault), + PrepareRenamePlaceholder(PrepareRenamePlaceholder), + DefaultBehavior(PrepareRenameDefaultBehavior), } /// A document selector is the combination of one or many document filters. @@ -1951,43 +1937,13 @@ pub enum WorkspaceDocumentDiagnosticReport { Unchanged(WorkspaceUnchangedDocumentDiagnosticReport), } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTextDocumentContentChangeEvent { - /// The range of the document that changed. - pub range: Range, - - /// The optional length of the range that got replaced. - /// - /// @deprecated use range instead. - pub range_length: Option, - - /// The new text for the provided range. - pub text: String, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTextDocumentContentChangeEventText { - /// The new text of the whole document. - pub text: String, -} - /// An event describing a change to a text document. If only a text is provided /// it is considered to be the full content of the document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(untagged)] pub enum TextDocumentContentChangeEvent { - Range(StructTextDocumentContentChangeEvent), - Text(StructTextDocumentContentChangeEventText), -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructMarkedString { - pub language: String, - - pub value: String, + Partial(TextDocumentContentChangePartial), + Whole(TextDocumentContentChangeWholeDocument), } /// MarkedString can be used to render human readable text. It is either a markdown string @@ -2007,7 +1963,7 @@ pub struct StructMarkedString { #[serde(untagged)] pub enum MarkedString { String(String), - MarkedString(StructMarkedString), + MarkedStringWithLanguage(MarkedStringWithLanguage), } /// A document filter describes a top level text document or @@ -2031,45 +1987,6 @@ pub enum GlobPattern { Relative(RelativePattern), } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTextDocumentFilter { - /// A language id, like `typescript`. - pub language: String, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: Option, - - /// A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. - pub pattern: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTextDocumentFilterScheme { - /// A language id, like `typescript`. - pub language: Option, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: String, - - /// A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. - pub pattern: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTextDocumentFilterPattern { - /// A language id, like `typescript`. - pub language: Option, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: Option, - - /// A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. - pub pattern: String, -} - /// A document filter denotes a document by different properties like /// the [language][`TextDocument::languageId`], the [scheme][`Uri::scheme`] of /// its resource, or a glob-pattern that is applied to the [path][`TextDocument::fileName`]. @@ -2089,61 +2006,9 @@ pub struct StructTextDocumentFilterPattern { #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(untagged)] pub enum TextDocumentFilter { - Language(StructTextDocumentFilter), - Scheme(StructTextDocumentFilterScheme), - Pattern(StructTextDocumentFilterPattern), -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructNotebookDocumentFilter { - /// The type of the enclosing notebook. - pub notebook_type: String, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: Option, - - /// A glob pattern. - pub pattern: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructNotebookDocumentFilterScheme { - /// The type of the enclosing notebook. - pub notebook_type: Option, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: String, - - /// A glob pattern. - pub pattern: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructNotebookDocumentFilterPattern { - /// The type of the enclosing notebook. - pub notebook_type: Option, - - /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. - pub scheme: Option, - - /// A glob pattern. - pub pattern: String, -} - -/// A notebook document filter denotes a notebook document by -/// different properties. The properties will be match -/// against the notebook's URI (same as with documents) -/// -/// @since 3.17.0 -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(untagged)] -pub enum NotebookDocumentFilter { - Type(StructNotebookDocumentFilter), - Scheme(StructNotebookDocumentFilterScheme), - Pattern(StructNotebookDocumentFilterPattern), + Language(TextDocumentFilterLanguage), + Scheme(TextDocumentFilterScheme), + Pattern(TextDocumentFilterPattern), } /// The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: @@ -2157,6 +2022,19 @@ pub enum NotebookDocumentFilter { /// @since 3.17.0 pub type Pattern = String; +/// A notebook document filter denotes a notebook document by +/// different properties. The properties will be match +/// against the notebook's URI (same as with documents) +/// +/// @since 3.17.0 +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(untagged)] +pub enum NotebookDocumentFilter { + Type(NotebookDocumentFilterNotebookType), + Scheme(NotebookDocumentFilterScheme), + Pattern(NotebookDocumentFilterPattern), +} + #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ImplementationParams { @@ -2646,13 +2524,6 @@ pub struct SemanticTokensPartialResult { pub data: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructOptions { - /// The server supports deltas for full documents. - pub delta: Option, -} - /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -2663,7 +2534,7 @@ pub struct SemanticTokensRegistrationOptions { pub document_selector: Option, /// Server supports providing semantic tokens for a full document. - pub full: Option>, + pub full: Option>, /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. @@ -3419,16 +3290,6 @@ pub struct UnregistrationParams { pub unregisterations: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructClientInfo { - /// The name of the client as defined by the client. - pub name: String, - - /// The client's version as defined by the client. - pub version: Option, -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct InitializeParams { @@ -3438,7 +3299,7 @@ pub struct InitializeParams { /// Information about the client /// /// @since 3.15.0 - pub client_info: Option, + pub client_info: Option, /// User provided initialization options. pub initialization_options: Option, @@ -3490,16 +3351,6 @@ pub struct InitializeParams { pub workspace_folders: Option>, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructServerInfo { - /// The name of the server as defined by the server. - pub name: String, - - /// The server's version as defined by the server. - pub version: Option, -} - /// The result returned from an initialize request. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -3510,7 +3361,7 @@ pub struct InitializeResult { /// Information about the server. /// /// @since 3.15.0 - pub server_info: Option, + pub server_info: Option, } /// The data type of the ResponseError if the @@ -3886,43 +3737,6 @@ pub struct CompletionItem { pub text_edit_text: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructInsert { - pub insert: Range, - - pub replace: Range, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructItemDefaults { - /// A default commit character set. - /// - /// @since 3.17.0 - pub commit_characters: Option>, - - /// A default edit range. - /// - /// @since 3.17.0 - pub edit_range: Option>, - - /// A default insert text format. - /// - /// @since 3.17.0 - pub insert_text_format: Option, - - /// A default insert text mode. - /// - /// @since 3.17.0 - pub insert_text_mode: Option, - - /// A default data value. - /// - /// @since 3.17.0 - pub data: Option, -} - /// Represents a collection of [completion items][CompletionItem] to be presented /// in the editor. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -3947,23 +3761,12 @@ pub struct CompletionList { /// capability. /// /// @since 3.17.0 - pub item_defaults: Option, + pub item_defaults: Option, /// The completion items. pub items: Vec, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructCompletionItem { - /// The server has support for completion item label - /// details (see also `CompletionItemLabelDetails`) when - /// receiving a completion item in a resolve call. - /// - /// @since 3.17.0 - pub label_details_support: Option, -} - /// Registration options for a [CompletionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -3982,7 +3785,7 @@ pub struct CompletionRegistrationOptions { /// capabilities. /// /// @since 3.17.0 - pub completion_item: Option, + pub completion_item: Option, /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4361,15 +4164,6 @@ pub struct Command { pub title: String, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructDisabled { - /// Human readable description of why the code action is currently disabled. - /// - /// This is displayed in the code actions UI. - pub reason: String, -} - /// A code action represents a change that can be performed in code, e.g. to fix a problem or /// to refactor code. /// @@ -4406,7 +4200,7 @@ pub struct CodeAction { /// error message with `reason` in the editor. /// /// @since 3.16.0 - pub disabled: Option, + pub disabled: Option, /// The workspace edit this code action performs. pub edit: Option, @@ -4467,12 +4261,6 @@ pub struct WorkspaceSymbolParams { pub work_done_token: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructUri { - pub uri: String, -} - /// A special workspace symbol that supports locations without a range. /// /// See also SymbolInformation. @@ -4499,7 +4287,7 @@ pub struct WorkspaceSymbol { /// capability `workspace.symbol.resolveSupport`. /// /// See SymbolInformation#location for more details. - pub location: OR2, + pub location: OR2, /// The name of this symbol. pub name: String, @@ -5164,7 +4952,7 @@ pub struct CallHierarchyOptions { #[serde(rename_all = "camelCase")] pub struct SemanticTokensOptions { /// Server supports providing semantic tokens for a full document. - pub full: Option>, + pub full: Option>, /// The legend used by the server pub legend: SemanticTokensLegend, @@ -5690,42 +5478,6 @@ pub struct VersionedNotebookDocumentIdentifier { pub version: i32, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructStructure { - /// The change to the cell array. - pub array: NotebookCellArrayChange, - - /// Additional opened cell text documents. - pub did_open: Option>, - - /// Additional closed cell text documents. - pub did_close: Option>, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructDocument { - pub document: VersionedTextDocumentIdentifier, - - pub changes: Vec, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructCells { - /// Changes to the cell structure to add or - /// remove cells. - pub structure: Option, - - /// Changes to notebook cells properties like its - /// kind, execution summary or metadata. - pub data: Option>, - - /// Changes to the text content of notebook cells. - pub text_content: Option>, -} - /// A change event for a notebook document. /// /// @since 3.17.0 @@ -5733,7 +5485,7 @@ pub struct StructCells { #[serde(rename_all = "camelCase")] pub struct NotebookDocumentChangeEvent { /// Changes to cells - pub cells: Option, + pub cells: Option, /// The changed meta data if any. /// @@ -5835,7 +5587,7 @@ pub struct _InitializeParams { /// Information about the client /// /// @since 3.15.0 - pub client_info: Option, + pub client_info: Option, /// User provided initialization options. pub initialization_options: Option, @@ -5894,20 +5646,6 @@ pub struct WorkspaceFoldersInitializeParams { pub workspace_folders: Option>, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructWorkspace { - /// The server supports workspace folder. - /// - /// @since 3.6.0 - pub workspace_folders: Option, - - /// The server is interested in notifications/requests for operations on files. - /// - /// @since 3.16.0 - pub file_operations: Option, -} - /// Defines the capabilities provided by a language /// server. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -6062,12 +5800,28 @@ pub struct ServerCapabilities { Option>, /// Workspace specific server capabilities. - pub workspace: Option, + pub workspace: Option, /// The server provides workspace symbol support. pub workspace_symbol_provider: Option>, } +/// Information about the server +/// +/// @since 3.15.0 +/// @since 3.18.0 ServerInfo type name added. +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0 ServerInfo type name added.")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ServerInfo { + /// The name of the server as defined by the server. + pub name: String, + + /// The server's version as defined by the server. + pub version: Option, +} + /// A text document identifier to denote a specific version of a text document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6201,6 +5955,48 @@ pub struct InsertReplaceEdit { pub replace: Range, } +/// In many cases the items of an actual completion result share the same +/// value for properties like `commitCharacters` or the range of a text +/// edit. A completion list can therefore define item defaults which will +/// be used if a completion item itself doesn't specify the value. +/// +/// If a completion list specifies a default value and a completion item +/// also specifies a corresponding value the one from the item is used. +/// +/// Servers are only allowed to return default values if the client +/// signals support for this via the `completionList.itemDefaults` +/// capability. +/// +/// @since 3.17.0 +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CompletionItemDefaults { + /// A default commit character set. + /// + /// @since 3.17.0 + pub commit_characters: Option>, + + /// A default data value. + /// + /// @since 3.17.0 + pub data: Option, + + /// A default edit range. + /// + /// @since 3.17.0 + pub edit_range: Option>, + + /// A default insert text format. + /// + /// @since 3.17.0 + pub insert_text_format: Option, + + /// A default insert text mode. + /// + /// @since 3.17.0 + pub insert_text_mode: Option, +} + /// Completion options. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6219,7 +6015,7 @@ pub struct CompletionOptions { /// capabilities. /// /// @since 3.17.0 - pub completion_item: Option, + pub completion_item: Option, /// The server provides support to resolve additional /// information for a completion item. @@ -6404,6 +6200,20 @@ pub struct CodeActionContext { pub trigger_kind: Option, } +/// Captures why the code action is currently disabled. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CodeActionDisabled { + /// Human readable description of why the code action is currently disabled. + /// + /// This is displayed in the code actions UI. + pub reason: String, +} + /// Provider options for a [CodeActionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6423,6 +6233,17 @@ pub struct CodeActionOptions { pub work_done_progress: Option, } +/// Location with only uri and does not include range. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct LocationUriOnly { + pub uri: String, +} + /// Server capabilities for a [WorkspaceSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6526,6 +6347,26 @@ pub struct RenameOptions { pub work_done_progress: Option, } +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PrepareRenamePlaceholder { + pub placeholder: String, + + pub range: Range, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct PrepareRenameDefaultBehavior { + pub default_behavior: bool, +} + /// The server capabilities of a [ExecuteCommandRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6547,6 +6388,18 @@ pub struct SemanticTokensLegend { pub token_types: Vec, } +/// Semantic tokens options to support deltas for full documents +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct SemanticTokensFullDelta { + /// The server supports deltas for full documents. + pub delta: Option, +} + /// A text document identifier to optionally denote a specific version of a text document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6730,21 +6583,24 @@ pub struct NotebookCell { pub metadata: Option, } -/// A change describing how to move a `NotebookCell` -/// array from state S to S'. +/// Cell changes to a notebook document. /// -/// @since 3.17.0 +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct NotebookCellArrayChange { - /// The new cells, if any - pub cells: Option>, +pub struct NotebookDocumentCellChanges { + /// Changes to notebook cells properties like its + /// kind, execution summary or metadata. + pub data: Option>, - /// The deleted cells - pub delete_count: u32, + /// Changes to the cell structure to add or + /// remove cells. + pub structure: Option, - /// The start oftest of the cell that changed. - pub start: u32, + /// Changes to the text content of notebook cells. + pub text_content: Option>, } /// Describes the currently selected completion item. @@ -6762,6 +6618,22 @@ pub struct SelectedCompletionInfo { pub text: String, } +/// Information about the client +/// +/// @since 3.15.0 +/// @since 3.18.0 ClientInfo type name added. +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0 ClientInfo type name added.")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientInfo { + /// The name of the client as defined by the client. + pub name: String, + + /// The client's version as defined by the client. + pub version: Option, +} + /// Defines the capabilities provided by the client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6813,42 +6685,6 @@ pub struct TextDocumentSyncOptions { pub will_save_wait_until: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructLanguage { - pub language: String, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructNotebook { - /// The notebook to be synced If a string - /// value is provided it matches against the - /// notebook type. '*' matches every notebook. - pub notebook: OR2, - - /// The cells of the matching notebook to be synced. - pub cells: Option>, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructLanguage2 { - pub language: String, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructCells2 { - /// The notebook to be synced If a string - /// value is provided it matches against the - /// notebook type. '*' matches every notebook. - pub notebook: Option>, - - /// The cells of the matching notebook to be synced. - pub cells: Vec, -} - /// Options specific to a notebook plus its cells /// to be synced to the server. /// @@ -6866,7 +6702,8 @@ pub struct StructCells2 { #[serde(rename_all = "camelCase")] pub struct NotebookDocumentSyncOptions { /// The notebooks to be synced - pub notebook_selector: Vec>, + pub notebook_selector: + Vec>, /// Whether save notification should be forwarded to /// the server. Will only be honored if mode === `notebook`. @@ -6884,52 +6721,60 @@ pub struct NotebookDocumentSyncRegistrationOptions { pub id: Option, /// The notebooks to be synced - pub notebook_selector: Vec>, + pub notebook_selector: + Vec>, /// Whether save notification should be forwarded to /// the server. Will only be honored if mode === `notebook`. pub save: Option, } +/// Defines workspace specific capabilities of the server. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct WorkspaceFoldersServerCapabilities { - /// Whether the server wants to receive workspace folder - /// change notifications. +pub struct WorkspaceOptions { + /// The server is interested in notifications/requests for operations on files. /// - /// If a string is provided the string is treated as an ID - /// under which the notification is registered on the client - /// side. The ID can be used to unregister for these events - /// using the `client/unregisterCapability` request. - pub change_notifications: Option>, + /// @since 3.16.0 + pub file_operations: Option, - /// The server has support for workspace folders - pub supported: Option, + /// The server supports workspace folder. + /// + /// @since 3.6.0 + pub workspace_folders: Option, } -/// Options for notifications/requests for user operations on files. -/// -/// @since 3.16.0 +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct FileOperationOptions { - /// The server is interested in receiving didCreateFiles notifications. - pub did_create: Option, - - /// The server is interested in receiving didDeleteFiles file notifications. - pub did_delete: Option, - - /// The server is interested in receiving didRenameFiles notifications. - pub did_rename: Option, +pub struct TextDocumentContentChangePartial { + /// The range of the document that changed. + pub range: Range, - /// The server is interested in receiving willCreateFiles requests. - pub will_create: Option, + /// The optional length of the range that got replaced. + /// + /// @deprecated use range instead. + #[deprecated] + pub range_length: Option, - /// The server is interested in receiving willDeleteFiles file requests. - pub will_delete: Option, + /// The new text for the provided range. + pub text: String, +} - /// The server is interested in receiving willRenameFiles requests. - pub will_rename: Option, +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TextDocumentContentChangeWholeDocument { + /// The new text of the whole document. + pub text: String, } /// Structure to capture a description for an error code. @@ -6955,6 +6800,45 @@ pub struct DiagnosticRelatedInformation { pub message: String, } +/// Edit range variant that includes ranges for insert and replace operations. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct EditRangeWithInsertReplace { + pub insert: Range, + + pub replace: Range, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ServerCompletionItemOptions { + /// The server has support for completion item label + /// details (see also `CompletionItemLabelDetails`) when + /// receiving a completion item in a resolve call. + /// + /// @since 3.17.0 + pub label_details_support: Option, +} + +/// @since 3.18.0 +/// @proposed +/// @deprecated use MarkupContent instead. +#[deprecated] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct MarkedStringWithLanguage { + pub language: String, + + pub value: String, +} + /// Represents a parameter of a callable-signature. A parameter can /// have a label and a doc-comment. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -7018,23 +6902,54 @@ pub struct ExecutionSummary { pub success: Option, } -/// Workspace specific client capabilities. +/// Structural changes to cells in a notebook document. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct WorkspaceClientCapabilities { - /// The client supports applying batch edits - /// to the workspace by supporting the request - /// 'workspace/applyEdit' - pub apply_edit: Option, +pub struct NotebookDocumentCellChangeStructure { + /// The change to the cell array. + pub array: NotebookCellArrayChange, - /// Capabilities specific to the code lens requests scoped to the - /// workspace. - /// - /// @since 3.16.0. - pub code_lens: Option, + /// Additional closed cell text documents. + pub did_close: Option>, - /// The client supports `workspace/configuration` requests. - /// + /// Additional opened cell text documents. + pub did_open: Option>, +} + +/// Content changes to a cell in a notebook document. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookDocumentCellContentChanges { + pub changes: Vec, + + pub document: VersionedTextDocumentIdentifier, +} + +/// Workspace specific client capabilities. +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct WorkspaceClientCapabilities { + /// The client supports applying batch edits + /// to the workspace by supporting the request + /// 'workspace/applyEdit' + pub apply_edit: Option, + + /// Capabilities specific to the code lens requests scoped to the + /// workspace. + /// + /// @since 3.16.0. + pub code_lens: Option, + + /// The client supports `workspace/configuration` requests. + /// /// @since 3.6.0 pub configuration: Option, @@ -7263,18 +7178,6 @@ pub struct WindowClientCapabilities { pub work_done_progress: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructStaleRequestSupport { - /// The client will actively cancel the request. - pub cancel: bool, - - /// The list of requests for which the client - /// will retry the request if it receives a - /// response with error code `ContentModified` - pub retry_on_content_modified: Vec, -} - /// General client capabilities. /// /// @since 3.16.0 @@ -7317,7 +7220,78 @@ pub struct GeneralClientCapabilities { /// anymore since the information is outdated). /// /// @since 3.17.0 - pub stale_request_support: Option, + pub stale_request_support: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookDocumentFilterWithNotebook { + /// The cells of the matching notebook to be synced. + pub cells: Option>, + + /// The notebook to be synced If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + pub notebook: OR2, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookDocumentFilterWithCells { + /// The cells of the matching notebook to be synced. + pub cells: Vec, + + /// The notebook to be synced If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + pub notebook: Option>, +} + +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct WorkspaceFoldersServerCapabilities { + /// Whether the server wants to receive workspace folder + /// change notifications. + /// + /// If a string is provided the string is treated as an ID + /// under which the notification is registered on the client + /// side. The ID can be used to unregister for these events + /// using the `client/unregisterCapability` request. + pub change_notifications: Option>, + + /// The server has support for workspace folders + pub supported: Option, +} + +/// Options for notifications/requests for user operations on files. +/// +/// @since 3.16.0 +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct FileOperationOptions { + /// The server is interested in receiving didCreateFiles notifications. + pub did_create: Option, + + /// The server is interested in receiving didDeleteFiles file notifications. + pub did_delete: Option, + + /// The server is interested in receiving didRenameFiles notifications. + pub did_rename: Option, + + /// The server is interested in receiving willCreateFiles requests. + pub will_create: Option, + + /// The server is interested in receiving willDeleteFiles file requests. + pub will_delete: Option, + + /// The server is interested in receiving willRenameFiles requests. + pub will_rename: Option, } /// A relative pattern is a helper to construct glob patterns that are matched @@ -7336,13 +7310,75 @@ pub struct RelativePattern { pub pattern: Pattern, } +/// A document filter where `language` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct StructChangeAnnotationSupport { - /// Whether the client groups edits with equal labels into tree nodes, - /// for instance all edits labelled with "Changes in Strings" would - /// be a tree node. - pub groups_on_label: Option, +pub struct TextDocumentFilterLanguage { + /// A language id, like `typescript`. + pub language: String, + + /// A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. + pub pattern: Option, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: Option, +} + +/// A document filter where `scheme` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TextDocumentFilterScheme { + /// A language id, like `typescript`. + pub language: Option, + + /// A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. + pub pattern: Option, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: String, +} + +/// A document filter where `pattern` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TextDocumentFilterPattern { + /// A language id, like `typescript`. + pub language: Option, + + /// A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. + pub pattern: String, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: Option, +} + +/// A change describing how to move a `NotebookCell` +/// array from state S to S'. +/// +/// @since 3.17.0 +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookCellArrayChange { + /// The new cells, if any + pub cells: Option>, + + /// The deleted cells + pub delete_count: u32, + + /// The start oftest of the cell that changed. + pub start: u32, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -7352,7 +7388,7 @@ pub struct WorkspaceEditClientCapabilities { /// create file, rename file and delete file changes. /// /// @since 3.16.0 - pub change_annotation_support: Option, + pub change_annotation_support: Option, /// The client supports versioned document changes in `WorkspaceEdit`s pub document_changes: Option, @@ -7401,35 +7437,6 @@ pub struct DidChangeWatchedFilesClientCapabilities { pub relative_pattern_support: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructResolveSupport { - /// The properties that a client can resolve lazily. Usually - /// `location.range` - pub properties: Vec, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructSymbolKind { - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - pub value_set: Option>, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTagSupport { - /// The tags supported by the client. - pub value_set: Vec, -} - /// Client capabilities for a [WorkspaceSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -7442,16 +7449,16 @@ pub struct WorkspaceSymbolClientCapabilities { /// properties. /// /// @since 3.17.0 - pub resolve_support: Option, + pub resolve_support: Option, /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - pub symbol_kind: Option, + pub symbol_kind: Option, /// The client supports tags on `SymbolInformation`. /// Clients supporting tags have to handle unknown tags gracefully. /// /// @since 3.16.0 - pub tag_support: Option, + pub tag_support: Option, } /// The client capabilities of a [ExecuteCommandRequest]. @@ -7609,200 +7616,66 @@ pub struct TextDocumentSyncClientCapabilities { pub will_save_wait_until: Option, } +/// Completion client capabilities #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct StructTagSupportValue { - /// The tags supported by the client. - pub value_set: Vec, -} +pub struct CompletionClientCapabilities { + /// The client supports the following `CompletionItem` specific + /// capabilities. + pub completion_item: Option, -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructResolveSupportProperties { - /// The properties that a client can resolve lazily. - pub properties: Vec, + pub completion_item_kind: Option, + + /// The client supports the following `CompletionList` specific + /// capabilities. + /// + /// @since 3.17.0 + pub completion_list: Option, + + /// The client supports to send additional context information for a + /// `textDocument/completion` request. + pub context_support: Option, + + /// Whether completion supports dynamic registration. + pub dynamic_registration: Option, + + /// Defines how the client handles whitespace and indentation + /// when accepting a completion item that uses multi line + /// text in either `insertText` or `textEdit`. + /// + /// @since 3.17.0 + pub insert_text_mode: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct StructInsertTextModeSupport { - pub value_set: Vec, +pub struct HoverClientCapabilities { + /// Client supports the following content formats for the content + /// property. The order describes the preferred format of the client. + pub content_format: Option>, + + /// Whether hover supports dynamic registration. + pub dynamic_registration: Option, } +/// Client Capabilities for a [SignatureHelpRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] -pub struct StructCompletionItemOptions { - /// Client supports snippets as insert text. +pub struct SignatureHelpClientCapabilities { + /// The client supports to send additional context information for a + /// `textDocument/signatureHelp` request. A client that opts into + /// contextSupport will also support the `retriggerCharacters` on + /// `SignatureHelpOptions`. /// - /// A snippet can define tab stops and placeholders with `$1`, `$2` - /// and `${3:foo}`. `$0` defines the final tab stop, it defaults to - /// the end of the snippet. Placeholders with equal identifiers are linked, - /// that is typing in one will update others too. - pub snippet_support: Option, - - /// Client supports commit characters on a completion item. - pub commit_characters_support: Option, + /// @since 3.15.0 + pub context_support: Option, - /// Client supports the following content formats for the documentation - /// property. The order describes the preferred format of the client. - pub documentation_format: Option>, - - /// Client supports the deprecated property on a completion item. - pub deprecated_support: Option, - - /// Client supports the preselect property on a completion item. - pub preselect_support: Option, - - /// Client supports the tag property on a completion item. Clients supporting - /// tags have to handle unknown tags gracefully. Clients especially need to - /// preserve unknown tags when sending a completion item back to the server in - /// a resolve call. - /// - /// @since 3.15.0 - pub tag_support: Option, - - /// Client support insert replace edit to control different behavior if a - /// completion item is inserted in the text or should replace text. - /// - /// @since 3.16.0 - pub insert_replace_support: Option, - - /// Indicates which properties a client can resolve lazily on a completion - /// item. Before version 3.16.0 only the predefined properties `documentation` - /// and `details` could be resolved lazily. - /// - /// @since 3.16.0 - pub resolve_support: Option, - - /// The client supports the `insertTextMode` property on - /// a completion item to override the whitespace handling mode - /// as defined by the client (see `insertTextMode`). - /// - /// @since 3.16.0 - pub insert_text_mode_support: Option, - - /// The client has support for completion item label - /// details (see also `CompletionItemLabelDetails`). - /// - /// @since 3.17.0 - pub label_details_support: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructCompletionItemKind { - /// The completion item kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the completion items kinds from `Text` to `Reference` as defined in - /// the initial version of the protocol. - pub value_set: Option>, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructCompletionList { - /// The client supports the following itemDefaults on - /// a completion list. - /// - /// The value lists the supported property names of the - /// `CompletionList.itemDefaults` object. If omitted - /// no properties are supported. - /// - /// @since 3.17.0 - pub item_defaults: Option>, -} - -/// Completion client capabilities -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct CompletionClientCapabilities { - /// The client supports the following `CompletionItem` specific - /// capabilities. - pub completion_item: Option, - - pub completion_item_kind: Option, - - /// The client supports the following `CompletionList` specific - /// capabilities. - /// - /// @since 3.17.0 - pub completion_list: Option, - - /// The client supports to send additional context information for a - /// `textDocument/completion` request. - pub context_support: Option, - - /// Whether completion supports dynamic registration. - pub dynamic_registration: Option, - - /// Defines how the client handles whitespace and indentation - /// when accepting a completion item that uses multi line - /// text in either `insertText` or `textEdit`. - /// - /// @since 3.17.0 - pub insert_text_mode: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct HoverClientCapabilities { - /// Client supports the following content formats for the content - /// property. The order describes the preferred format of the client. - pub content_format: Option>, - - /// Whether hover supports dynamic registration. - pub dynamic_registration: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructParameterInformation { - /// The client supports processing label offsets instead of a - /// simple label string. - /// - /// @since 3.14.0 - pub label_offset_support: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructSignatureInformation { - /// Client supports the following content formats for the documentation - /// property. The order describes the preferred format of the client. - pub documentation_format: Option>, - - /// Client capabilities specific to parameter information. - pub parameter_information: Option, - - /// The client supports the `activeParameter` property on `SignatureInformation` - /// literal. - /// - /// @since 3.16.0 - pub active_parameter_support: Option, -} - -/// Client Capabilities for a [SignatureHelpRequest]. -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct SignatureHelpClientCapabilities { - /// The client supports to send additional context information for a - /// `textDocument/signatureHelp` request. A client that opts into - /// contextSupport will also support the `retriggerCharacters` on - /// `SignatureHelpOptions`. - /// - /// @since 3.15.0 - pub context_support: Option, - - /// Whether signature help supports dynamic registration. - pub dynamic_registration: Option, + /// Whether signature help supports dynamic registration. + pub dynamic_registration: Option, /// The client supports the following `SignatureInformation` /// specific properties. - pub signature_information: Option, + pub signature_information: Option, } /// @since 3.14.0 @@ -7877,27 +7750,6 @@ pub struct DocumentHighlightClientCapabilities { pub dynamic_registration: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructSymbolKindOptions { - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - pub value_set: Option>, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTagSupportValueSet { - /// The tags supported by the client. - pub value_set: Vec, -} - /// Client Capabilities for a [DocumentSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -7916,39 +7768,14 @@ pub struct DocumentSymbolClientCapabilities { /// Specific capabilities for the `SymbolKind` in the /// `textDocument/documentSymbol` request. - pub symbol_kind: Option, + pub symbol_kind: Option, /// The client supports tags on `SymbolInformation`. Tags are supported on /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. /// Clients supporting tags have to handle unknown tags gracefully. /// /// @since 3.16.0 - pub tag_support: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructCodeActionKind { - /// The code action kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - pub value_set: Vec>, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructCodeActionLiteralSupport { - /// The code action kind is support with the following value - /// set. - pub code_action_kind: StructCodeActionKind, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructResolveSupportProperties2 { - /// The properties that a client can resolve lazily. - pub properties: Vec, + pub tag_support: Option, } /// The Client Capabilities of a [CodeActionRequest]. @@ -7960,7 +7787,7 @@ pub struct CodeActionClientCapabilities { /// set the request can only return `Command` literals. /// /// @since 3.8.0 - pub code_action_literal_support: Option, + pub code_action_literal_support: Option, /// Whether code action supports the `data` property which is /// preserved between a `textDocument/codeAction` and a @@ -7995,7 +7822,7 @@ pub struct CodeActionClientCapabilities { /// properties via a separate `codeAction/resolve` request. /// /// @since 3.16.0 - pub resolve_support: Option, + pub resolve_support: Option, } /// The client capabilities of a [CodeLensRequest]. @@ -8089,26 +7916,6 @@ pub struct RenameClientCapabilities { pub prepare_support_default_behavior: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructFoldingRange { - /// If set, the client signals that it supports setting collapsedText on - /// folding ranges to display custom labels instead of the default text. - /// - /// @since 3.17.0 - pub collapsed_text: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructFoldingRangeKind { - /// The folding range kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - pub value_set: Option>>, -} - #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct FoldingRangeClientCapabilities { @@ -8121,12 +7928,12 @@ pub struct FoldingRangeClientCapabilities { /// Specific options for the folding range. /// /// @since 3.17.0 - pub folding_range: Option, + pub folding_range: Option, /// Specific options for the folding range kind. /// /// @since 3.17.0 - pub folding_range_kind: Option, + pub folding_range_kind: Option, /// If set, the client signals that it only supports folding complete lines. /// If set, client will ignore specified `startCharacter` and `endCharacter` @@ -8148,13 +7955,6 @@ pub struct SelectionRangeClientCapabilities { pub dynamic_registration: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructTagSupportValueSet2 { - /// The tags supported by the client. - pub value_set: Vec, -} - /// The publish diagnostic client capabilities. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -8178,7 +7978,7 @@ pub struct PublishDiagnosticsClientCapabilities { /// Clients supporting tags have to handle unknown tags gracefully. /// /// @since 3.15.0 - pub tag_support: Option, + pub tag_support: Option, /// Whether the client interprets the version property of the /// `textDocument/publishDiagnostics` notification's parameter. @@ -8197,26 +7997,6 @@ pub struct CallHierarchyClientCapabilities { pub dynamic_registration: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructOptions2 { - /// The client will send the `textDocument/semanticTokens/full/delta` request if - /// the server provides a corresponding handler. - pub delta: Option, -} - -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructRequests { - /// The client will send the `textDocument/semanticTokens/range` request if - /// the server provides a corresponding handler. - pub range: Option>, - - /// The client will send the `textDocument/semanticTokens/full` request if - /// the server provides a corresponding handler. - pub full: Option>, -} - /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -8255,7 +8035,7 @@ pub struct SemanticTokensClientCapabilities { /// `request.range` are both set to true but the server only provides a /// range provider the client might not render a minimap correctly or might /// even decide to not show any semantic tokens at all. - pub requests: StructRequests, + pub requests: ClientSemanticTokensRequestOptions, /// Whether the client allows the server to actively cancel a /// semantic token request, e.g. supports returning @@ -8316,13 +8096,6 @@ pub struct InlineValueClientCapabilities { pub dynamic_registration: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructResolveSupportProperties3 { - /// The properties that a client can resolve lazily. - pub properties: Vec, -} - /// Inlay hint client capabilities. /// /// @since 3.17.0 @@ -8334,7 +8107,7 @@ pub struct InlayHintClientCapabilities { /// Indicates which properties a client can resolve lazily on an inlay /// hint. - pub resolve_support: Option, + pub resolve_support: Option, } /// Client capabilities specific to diagnostic pull requests. @@ -8380,21 +8153,12 @@ pub struct NotebookDocumentSyncClientCapabilities { pub execution_summary_support: Option, } -#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] -pub struct StructMessageActionItem { - /// Whether the client supports additional attributes which - /// are preserved and send back to the server in the - /// request's response. - pub additional_properties_support: Option, -} - /// Show message request client capabilities #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ShowMessageRequestClientCapabilities { /// Capabilities specific to the `MessageActionItem` type. - pub message_action_item: Option, + pub message_action_item: Option, } /// Client capabilities for the showDocument request. @@ -8408,6 +8172,21 @@ pub struct ShowDocumentClientCapabilities { pub support: bool, } +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct StaleRequestSupportOptions { + /// The client will actively cancel the request. + pub cancel: bool, + + /// The list of requests for which the client + /// will retry the request if it receives a + /// response with error code `ContentModified` + pub retry_on_content_modified: Vec, +} + /// Client capabilities specific to regular expressions. /// /// @since 3.16.0 @@ -8440,6 +8219,396 @@ pub struct MarkdownClientCapabilities { pub version: Option, } +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookCellLanguage { + pub language: String, +} + +/// A notebook document filter where `notebookType` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookDocumentFilterNotebookType { + /// The type of the enclosing notebook. + pub notebook_type: String, + + /// A glob pattern. + pub pattern: Option, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: Option, +} + +/// A notebook document filter where `scheme` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookDocumentFilterScheme { + /// The type of the enclosing notebook. + pub notebook_type: Option, + + /// A glob pattern. + pub pattern: Option, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: String, +} + +/// A notebook document filter where `pattern` is required field. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct NotebookDocumentFilterPattern { + /// The type of the enclosing notebook. + pub notebook_type: Option, + + /// A glob pattern. + pub pattern: String, + + /// A Uri [scheme][`Uri::scheme`], like `file` or `untitled`. + pub scheme: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ChangeAnnotationsSupportOptions { + /// Whether the client groups edits with equal labels into tree nodes, + /// for instance all edits labelled with "Changes in Strings" would + /// be a tree node. + pub groups_on_label: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientSymbolKindOptions { + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + pub value_set: Option>, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientSymbolTagOptions { + /// The tags supported by the client. + pub value_set: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientSymbolResolveOptions { + /// The properties that a client can resolve lazily. Usually + /// `location.range` + pub properties: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientCompletionItemOptions { + /// Client supports commit characters on a completion item. + pub commit_characters_support: Option, + + /// Client supports the deprecated property on a completion item. + pub deprecated_support: Option, + + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. + pub documentation_format: Option>, + + /// Client support insert replace edit to control different behavior if a + /// completion item is inserted in the text or should replace text. + /// + /// @since 3.16.0 + pub insert_replace_support: Option, + + /// The client supports the `insertTextMode` property on + /// a completion item to override the whitespace handling mode + /// as defined by the client (see `insertTextMode`). + /// + /// @since 3.16.0 + pub insert_text_mode_support: Option, + + /// The client has support for completion item label + /// details (see also `CompletionItemLabelDetails`). + /// + /// @since 3.17.0 + pub label_details_support: Option, + + /// Client supports the preselect property on a completion item. + pub preselect_support: Option, + + /// Indicates which properties a client can resolve lazily on a completion + /// item. Before version 3.16.0 only the predefined properties `documentation` + /// and `details` could be resolved lazily. + /// + /// @since 3.16.0 + pub resolve_support: Option, + + /// Client supports snippets as insert text. + /// + /// A snippet can define tab stops and placeholders with `$1`, `$2` + /// and `${3:foo}`. `$0` defines the final tab stop, it defaults to + /// the end of the snippet. Placeholders with equal identifiers are linked, + /// that is typing in one will update others too. + pub snippet_support: Option, + + /// Client supports the tag property on a completion item. Clients supporting + /// tags have to handle unknown tags gracefully. Clients especially need to + /// preserve unknown tags when sending a completion item back to the server in + /// a resolve call. + /// + /// @since 3.15.0 + pub tag_support: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientCompletionItemOptionsKind { + /// The completion item kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the completion items kinds from `Text` to `Reference` as defined in + /// the initial version of the protocol. + pub value_set: Option>, +} + +/// The client supports the following `CompletionList` specific +/// capabilities. +/// +/// @since 3.17.0 +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CompletionListCapabilities { + /// The client supports the following itemDefaults on + /// a completion list. + /// + /// The value lists the supported property names of the + /// `CompletionList.itemDefaults` object. If omitted + /// no properties are supported. + /// + /// @since 3.17.0 + pub item_defaults: Option>, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientSignatureInformationOptions { + /// The client supports the `activeParameter` property on `SignatureInformation` + /// literal. + /// + /// @since 3.16.0 + pub active_parameter_support: Option, + + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. + pub documentation_format: Option>, + + /// Client capabilities specific to parameter information. + pub parameter_information: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientCodeActionLiteralOptions { + /// The code action kind is support with the following value + /// set. + pub code_action_kind: ClientCodeActionKindOptions, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientCodeActionResolveOptions { + /// The properties that a client can resolve lazily. + pub properties: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientFoldingRangeKindOptions { + /// The folding range kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + pub value_set: Option>>, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientFoldingRangeOptions { + /// If set, the client signals that it supports setting collapsedText on + /// folding ranges to display custom labels instead of the default text. + /// + /// @since 3.17.0 + pub collapsed_text: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientDiagnosticsTagOptions { + /// The tags supported by the client. + pub value_set: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientSemanticTokensRequestOptions { + /// The client will send the `textDocument/semanticTokens/full` request if + /// the server provides a corresponding handler. + pub full: Option>, + + /// The client will send the `textDocument/semanticTokens/range` request if + /// the server provides a corresponding handler. + pub range: Option>, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientInlayHintResolveOptions { + /// The properties that a client can resolve lazily. + pub properties: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientShowMessageActionItemOptions { + /// Whether the client supports additional attributes which + /// are preserved and send back to the server in the + /// request's response. + pub additional_properties_support: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct CompletionItemTagOptions { + /// The tags supported by the client. + pub value_set: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientCompletionItemResolveOptions { + /// The properties that a client can resolve lazily. + pub properties: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientCompletionItemInsertTextModeOptions { + pub value_set: Vec, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientSignatureParameterInformationOptions { + /// The client supports processing label offsets instead of a + /// simple label string. + /// + /// @since 3.14.0 + pub label_offset_support: Option, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientCodeActionKindOptions { + /// The code action kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + pub value_set: Vec>, +} + +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ClientSemanticTokensRequestFullDelta { + /// The client will send the `textDocument/semanticTokens/full/delta` request if + /// the server provides a corresponding handler. + pub delta: Option, +} + /// The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace /// folder configuration changes. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] diff --git a/scripts/onCreateCommand.sh b/scripts/onCreateCommand.sh index f867da4..f42a4ff 100644 --- a/scripts/onCreateCommand.sh +++ b/scripts/onCreateCommand.sh @@ -15,10 +15,10 @@ curl https://sh.rustup.rs -sSf | bash -s -- -y echo 'source $HOME/.cargo/env' >> ~/.bashrc # Install Python via pyenv . -pyenv install 3.8:latest 3.9:latest 3.10:latest 3.11:latest +pyenv install 3.8:latest 3.9:latest 3.10:latest 3.11:latest 3.12:latest # Set default Python version to 3.8 . -pyenv global 3.8.18 +pyenv global 3.8:latest # Create Virutal environment. pyenv exec python3.8 -m venv .venv From 6b9c3aee850c2176e1d778adb64f9e717ec68bf6 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 6 Nov 2023 12:52:11 -0800 Subject: [PATCH 08/27] Update hooks with new names --- packages/python/lsprotocol/_hooks.py | 103 ++++++++++++--------------- 1 file changed, 47 insertions(+), 56 deletions(-) diff --git a/packages/python/lsprotocol/_hooks.py b/packages/python/lsprotocol/_hooks.py index c90719f..cd4477c 100644 --- a/packages/python/lsprotocol/_hooks.py +++ b/packages/python/lsprotocol/_hooks.py @@ -496,8 +496,8 @@ def _markup_content_hook( Union[ OptionalPrimitive, lsp_types.MarkupContent, - lsp_types.MarkedString_Type1, - List[Union[OptionalPrimitive, lsp_types.MarkedString_Type1]], + lsp_types.MarkedStringWithLanguage, + List[Union[OptionalPrimitive, lsp_types.MarkedStringWithLanguage]], ] ]: if object_ is None: @@ -509,14 +509,14 @@ def _markup_content_hook( ( item if isinstance(item, (bool, int, str, float)) - else converter.structure(item, lsp_types.MarkedString_Type1) + else converter.structure(item, lsp_types.MarkedStringWithLanguage) ) for item in object_ ] if "kind" in object_: return converter.structure(object_, lsp_types.MarkupContent) else: - return converter.structure(object_, lsp_types.MarkedString_Type1) + return converter.structure(object_, lsp_types.MarkedStringWithLanguage) def _document_edit_hook( object_: Any, _: type @@ -544,25 +544,22 @@ def _document_edit_hook( def _semantic_tokens_hook( object_: Any, _: type - ) -> Union[OptionalPrimitive, lsp_types.SemanticTokensOptionsFullType1]: + ) -> Union[OptionalPrimitive, lsp_types.SemanticTokensFullDelta]: if object_ is None: return None if isinstance(object_, (bool, int, str, float)): return object_ - return converter.structure(object_, lsp_types.SemanticTokensOptionsFullType1) + return converter.structure(object_, lsp_types.SemanticTokensFullDelta) def _semantic_tokens_capabilities_hook( object_: Any, _: type - ) -> Union[ - OptionalPrimitive, - lsp_types.SemanticTokensClientCapabilitiesRequestsTypeFullType1, - ]: + ) -> Union[OptionalPrimitive, lsp_types.ClientSemanticTokensRequestFullDelta,]: if object_ is None: return None if isinstance(object_, (bool, int, str, float)): return object_ return converter.structure( - object_, lsp_types.SemanticTokensClientCapabilitiesRequestsTypeFullType1 + object_, lsp_types.ClientSemanticTokensRequestFullDelta ) def _code_action_kind_hook( @@ -622,29 +619,29 @@ def _watch_kind_hook( def _notebook_sync_option_selector_hook( object_: Any, _: type ) -> Union[ - lsp_types.NotebookDocumentSyncOptionsNotebookSelectorType1, - lsp_types.NotebookDocumentSyncOptionsNotebookSelectorType2, + lsp_types.NotebookDocumentFilterWithNotebook, + lsp_types.NotebookDocumentFilterWithCells, ]: if "notebook" in object_: return converter.structure( - object_, lsp_types.NotebookDocumentSyncOptionsNotebookSelectorType1 + object_, lsp_types.NotebookDocumentFilterWithNotebook ) else: return converter.structure( - object_, lsp_types.NotebookDocumentSyncOptionsNotebookSelectorType2 + object_, lsp_types.NotebookDocumentFilterWithCells ) def _semantic_token_registration_options_hook( object_: Any, _: type ) -> Optional[ - Union[OptionalPrimitive, lsp_types.SemanticTokensRegistrationOptionsFullType1] + Union[OptionalPrimitive, lsp_types.ClientSemanticTokensRequestFullDelta] ]: if object_ is None: return None if isinstance(object_, (bool, int, str, float)): return object_ return converter.structure( - object_, lsp_types.SemanticTokensRegistrationOptionsFullType1 + object_, lsp_types.ClientSemanticTokensRequestFullDelta ) def _inline_completion_provider_hook( @@ -702,18 +699,18 @@ def _symbol_list_hook( def _notebook_sync_registration_option_selector_hook( object_: Any, _: type ) -> Union[ - lsp_types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1, - lsp_types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2, + lsp_types.NotebookDocumentFilterWithNotebook, + lsp_types.NotebookDocumentFilterWithCells, ]: if "notebook" in object_: return converter.structure( object_, - lsp_types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1, + lsp_types.NotebookDocumentFilterWithNotebook, ) else: return converter.structure( object_, - lsp_types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2, + lsp_types.NotebookDocumentFilterWithCells, ) structure_hooks = [ @@ -936,8 +933,8 @@ def _notebook_sync_registration_option_selector_hook( Union[ lsp_types.MarkupContent, str, - lsp_types.MarkedString_Type1, - Sequence[Union[str, lsp_types.MarkedString_Type1]], + lsp_types.MarkedStringWithLanguage, + List[Union[str, lsp_types.MarkedStringWithLanguage]], ], _markup_content_hook, ), @@ -951,14 +948,14 @@ def _notebook_sync_registration_option_selector_hook( _document_edit_hook, ), ( - Optional[Union[bool, lsp_types.SemanticTokensOptionsFullType1]], + Optional[Union[bool, lsp_types.SemanticTokensFullDelta]], _semantic_tokens_hook, ), ( Optional[ Union[ bool, - lsp_types.SemanticTokensClientCapabilitiesRequestsTypeFullType1, + lsp_types.ClientSemanticTokensRequestFullDelta, ] ], _semantic_tokens_capabilities_hook, @@ -1013,8 +1010,8 @@ def _notebook_sync_registration_option_selector_hook( ), ( Union[ - lsp_types.NotebookDocumentSyncOptionsNotebookSelectorType1, - lsp_types.NotebookDocumentSyncOptionsNotebookSelectorType2, + lsp_types.NotebookDocumentFilterWithNotebook, + lsp_types.NotebookDocumentFilterWithCells, ], _notebook_sync_option_selector_hook, ), @@ -1028,7 +1025,7 @@ def _notebook_sync_registration_option_selector_hook( _position_encoding_hook, ), ( - Optional[Union[bool, lsp_types.SemanticTokensRegistrationOptionsFullType1]], + Optional[Union[bool, lsp_types.ClientSemanticTokensRequestFullDelta]], _semantic_token_registration_options_hook, ), ( @@ -1057,13 +1054,6 @@ def _notebook_sync_registration_option_selector_hook( ], _symbol_list_hook, ), - ( - Union[ - lsp_types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1, - lsp_types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2, - ], - _notebook_sync_registration_option_selector_hook, - ), ] for type_, hook in structure_hooks: converter.register_structure_hook(type_, hook) @@ -1088,9 +1078,9 @@ def _text_document_filter_hook( object_: Any, _: type ) -> Union[ str, - lsp_types.TextDocumentFilter_Type1, - lsp_types.TextDocumentFilter_Type2, - lsp_types.TextDocumentFilter_Type3, + lsp_types.TextDocumentFilterLanguage, + lsp_types.TextDocumentFilterScheme, + lsp_types.TextDocumentFilterPattern, lsp_types.NotebookCellTextDocumentFilter, ]: if isinstance(object_, str): @@ -1100,30 +1090,31 @@ def _text_document_filter_hook( object_, lsp_types.NotebookCellTextDocumentFilter ) elif "language" in object_: - return converter.structure(object_, lsp_types.TextDocumentFilter_Type1) + return converter.structure(object_, lsp_types.TextDocumentFilterLanguage) elif "scheme" in object_: - return converter.structure(object_, lsp_types.TextDocumentFilter_Type2) + return converter.structure(object_, lsp_types.TextDocumentFilterScheme) else: - return converter.structure(object_, lsp_types.TextDocumentFilter_Type3) + return converter.structure(object_, lsp_types.TextDocumentFilterPattern) def _notebook_filter_hook( object_: Any, _: type ) -> Union[ str, - lsp_types.NotebookDocumentFilter_Type1, - lsp_types.NotebookDocumentFilter_Type2, - lsp_types.NotebookDocumentFilter_Type3, + lsp_types.NotebookDocumentFilterNotebookType, + lsp_types.NotebookDocumentFilterScheme, + lsp_types.NotebookDocumentFilterPattern, ]: if isinstance(object_, str): return str(object_) elif "notebookType" in object_: - return converter.structure(object_, lsp_types.NotebookDocumentFilter_Type1) + return converter.structure( + object_, lsp_types.NotebookDocumentFilterNotebookType + ) elif "scheme" in object_: - return converter.structure(object_, lsp_types.NotebookDocumentFilter_Type2) + return converter.structure(object_, lsp_types.NotebookDocumentFilterScheme) else: - return converter.structure(object_, lsp_types.NotebookDocumentFilter_Type3) + return converter.structure(object_, lsp_types.NotebookDocumentFilterPattern) - # TODO: Remove the ignore after this issue with attrs is addressed in either attrs or mypy NotebookSelectorItem = attrs.fields( lsp_types.NotebookCellTextDocumentFilter ).notebook.type @@ -1136,9 +1127,9 @@ def _notebook_filter_hook( (Optional[Union[bool, Any]], lambda object_, _type: object_), ( Union[ - lsp_types.TextDocumentFilter_Type1, - lsp_types.TextDocumentFilter_Type2, - lsp_types.TextDocumentFilter_Type3, + lsp_types.TextDocumentFilterLanguage, + lsp_types.TextDocumentFilterScheme, + lsp_types.TextDocumentFilterPattern, lsp_types.NotebookCellTextDocumentFilter, ], _text_document_filter_hook, @@ -1147,9 +1138,9 @@ def _notebook_filter_hook( ( Union[ str, - lsp_types.NotebookDocumentFilter_Type1, - lsp_types.NotebookDocumentFilter_Type2, - lsp_types.NotebookDocumentFilter_Type3, + lsp_types.NotebookDocumentFilterNotebookType, + lsp_types.NotebookDocumentFilterScheme, + lsp_types.NotebookDocumentFilterPattern, ], _notebook_filter_hook, ), @@ -1221,7 +1212,7 @@ def _omit(cls: type, prop: str) -> bool: special = lsp_types.is_special_property(cls, prop) return not special - def _with_custom_unstructure(cls: type) -> Any: + def _with_custom_unstructure(cls: attrs.AttrsInstance) -> Any: attributes = { a.name: cattrs.gen.override( rename=_to_camel_case(a.name), @@ -1231,7 +1222,7 @@ def _with_custom_unstructure(cls: type) -> Any: } return cattrs.gen.make_dict_unstructure_fn(cls, converter, **attributes) - def _with_custom_structure(cls: type) -> Any: + def _with_custom_structure(cls: attrs.AttrsInstance) -> Any: attributes = { a.name: cattrs.gen.override( rename=_to_camel_case(a.name), From df2eef98ba6b4af1f5b8eecaacade0233b650164 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 6 Nov 2023 13:05:38 -0800 Subject: [PATCH 09/27] Fix typing import in Python utils.py --- generator/plugins/python/utils.py | 5 +- packages/python/lsprotocol/types.py | 13617 -------------------------- 2 files changed, 3 insertions(+), 13619 deletions(-) diff --git a/generator/plugins/python/utils.py b/generator/plugins/python/utils.py index 0885057..757bf7e 100644 --- a/generator/plugins/python/utils.py +++ b/generator/plugins/python/utils.py @@ -576,7 +576,8 @@ def _add_type_alias(self, type_alias: model.TypeAlias) -> None: if type_alias.type.kind == "reference" and not self._has_type( type_alias.type.name ): - type_name = f"TypeAlias[{type_name}]" + # TODO: remove workaround for lack of TypeAlias + type_name = f"Union[{type_name}, {type_name}]" if type_name: # clean up the docstring for the class itself. @@ -587,7 +588,7 @@ def _add_type_alias(self, type_alias: model.TypeAlias) -> None: f"# Since: {_sanitize_comment(type_alias.since)}" if type_alias.since else "", - f"# Proposed" if type_alias.proposed else "", + "# Proposed" if type_alias.proposed else "", ] else: doc = _get_indented_documentation(type_alias.documentation, indent) diff --git a/packages/python/lsprotocol/types.py b/packages/python/lsprotocol/types.py index 4485e28..e69de29 100644 --- a/packages/python/lsprotocol/types.py +++ b/packages/python/lsprotocol/types.py @@ -1,13617 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -# ****** THIS IS A GENERATED FILE, DO NOT EDIT. ****** -# Steps to generate: -# 1. Checkout https://github.com/microsoft/lsprotocol -# 2. Install nox: `python -m pip install nox` -# 3. Run command: `python -m nox --session build_lsp` - -import enum -import functools -<<<<<<< HEAD -from typing import Any, Dict, Optional, Sequence, Tuple, Union -======= -from typing import Any, Dict, List, Optional, Tuple, TypeAlias, Union ->>>>>>> 1a6f18e (vNext LSP) - -import attrs - -from . import validators - -__lsp_version__ = "3.17.0" - - -@enum.unique -class SemanticTokenTypes(str, enum.Enum): - """A set of predefined token types. This set is not fixed - an clients can specify additional token types via the - corresponding client capabilities. - - @since 3.16.0""" - - # Since: 3.16.0 - Namespace = "namespace" - Type = "type" - """Represents a generic type. Acts as a fallback for types which can't be mapped to - a specific type like class or enum.""" - Class = "class" - Enum = "enum" - Interface = "interface" - Struct = "struct" - TypeParameter = "typeParameter" - Parameter = "parameter" - Variable = "variable" - Property = "property" - EnumMember = "enumMember" - Event = "event" - Function = "function" - Method = "method" - Macro = "macro" - Keyword = "keyword" - Modifier = "modifier" - Comment = "comment" - String = "string" - Number = "number" - Regexp = "regexp" - Operator = "operator" - Decorator = "decorator" - """@since 3.17.0""" - # Since: 3.17.0 - - -@enum.unique -class SemanticTokenModifiers(str, enum.Enum): - """A set of predefined token modifiers. This set is not fixed - an clients can specify additional token types via the - corresponding client capabilities. - - @since 3.16.0""" - - # Since: 3.16.0 - Declaration = "declaration" - Definition = "definition" - Readonly = "readonly" - Static = "static" - Deprecated = "deprecated" - Abstract = "abstract" - Async = "async" - Modification = "modification" - Documentation = "documentation" - DefaultLibrary = "defaultLibrary" - - -@enum.unique -class DocumentDiagnosticReportKind(str, enum.Enum): - """The document diagnostic report kinds. - - @since 3.17.0""" - - # Since: 3.17.0 - Full = "full" - """A diagnostic report with a full - set of problems.""" - Unchanged = "unchanged" - """A report indicating that the last - returned report is still accurate.""" - - -class ErrorCodes(int, enum.Enum): - """Predefined error codes.""" - - ParseError = -32700 - InvalidRequest = -32600 - MethodNotFound = -32601 - InvalidParams = -32602 - InternalError = -32603 - ServerNotInitialized = -32002 - """Error code indicating that a server received a notification or - request before the server has received the `initialize` request.""" - UnknownErrorCode = -32001 - - -class LSPErrorCodes(int, enum.Enum): - RequestFailed = -32803 - """A request failed but it was syntactically correct, e.g the - method name was known and the parameters were valid. The error - message should contain human readable information about why - the request failed. - - @since 3.17.0""" - # Since: 3.17.0 - ServerCancelled = -32802 - """The server cancelled the request. This error code should - only be used for requests that explicitly support being - server cancellable. - - @since 3.17.0""" - # Since: 3.17.0 - ContentModified = -32801 - """The server detected that the content of a document got - modified outside normal conditions. A server should - NOT send this error code if it detects a content change - in it unprocessed messages. The result even computed - on an older state might still be useful for the client. - - If a client decides that a result is not of any use anymore - the client should cancel the request.""" - RequestCancelled = -32800 - """The client has canceled a request and a server as detected - the cancel.""" - - -@enum.unique -class FoldingRangeKind(str, enum.Enum): - """A set of predefined range kinds.""" - - Comment = "comment" - """Folding range for a comment""" - Imports = "imports" - """Folding range for an import or include""" - Region = "region" - """Folding range for a region (e.g. `#region`)""" - - -@enum.unique -class SymbolKind(int, enum.Enum): - """A symbol kind.""" - - File = 1 - Module = 2 - Namespace = 3 - Package = 4 - Class = 5 - Method = 6 - Property = 7 - Field = 8 - Constructor = 9 - Enum = 10 - Interface = 11 - Function = 12 - Variable = 13 - Constant = 14 - String = 15 - Number = 16 - Boolean = 17 - Array = 18 - Object = 19 - Key = 20 - Null = 21 - EnumMember = 22 - Struct = 23 - Event = 24 - Operator = 25 - TypeParameter = 26 - - -@enum.unique -class SymbolTag(int, enum.Enum): - """Symbol tags are extra annotations that tweak the rendering of a symbol. - - @since 3.16""" - - # Since: 3.16 - Deprecated = 1 - """Render a symbol as obsolete, usually using a strike-out.""" - - -@enum.unique -class UniquenessLevel(str, enum.Enum): - """Moniker uniqueness level to define scope of the moniker. - - @since 3.16.0""" - - # Since: 3.16.0 - Document = "document" - """The moniker is only unique inside a document""" - Project = "project" - """The moniker is unique inside a project for which a dump got created""" - Group = "group" - """The moniker is unique inside the group to which a project belongs""" - Scheme = "scheme" - """The moniker is unique inside the moniker scheme.""" - Global = "global" - """The moniker is globally unique""" - - -@enum.unique -class MonikerKind(str, enum.Enum): - """The moniker kind. - - @since 3.16.0""" - - # Since: 3.16.0 - Import = "import" - """The moniker represent a symbol that is imported into a project""" - Export = "export" - """The moniker represents a symbol that is exported from a project""" - Local = "local" - """The moniker represents a symbol that is local to a project (e.g. a local - variable of a function, a class not visible outside the project, ...)""" - - -@enum.unique -class InlayHintKind(int, enum.Enum): - """Inlay hint kinds. - - @since 3.17.0""" - - # Since: 3.17.0 - Type = 1 - """An inlay hint that for a type annotation.""" - Parameter = 2 - """An inlay hint that is for a parameter.""" - - -@enum.unique -class MessageType(int, enum.Enum): - """The message type""" - - Error = 1 - """An error message.""" - Warning = 2 - """A warning message.""" - Info = 3 - """An information message.""" - Log = 4 - """A log message.""" - Debug = 5 - """A debug message. - - @since 3.18.0""" - # Since: 3.18.0 - - -@enum.unique -class TextDocumentSyncKind(int, enum.Enum): - """Defines how the host (editor) should sync - document changes to the language server.""" - - None_ = 0 - """Documents should not be synced at all.""" - Full = 1 - """Documents are synced by always sending the full content - of the document.""" - Incremental = 2 - """Documents are synced by sending the full content on open. - After that only incremental updates to the document are - send.""" - - -@enum.unique -class TextDocumentSaveReason(int, enum.Enum): - """Represents reasons why a text document is saved.""" - - Manual = 1 - """Manually triggered, e.g. by the user pressing save, by starting debugging, - or by an API call.""" - AfterDelay = 2 - """Automatic after a delay.""" - FocusOut = 3 - """When the editor lost focus.""" - - -@enum.unique -class CompletionItemKind(int, enum.Enum): - """The kind of a completion entry.""" - - Text = 1 - Method = 2 - Function = 3 - Constructor = 4 - Field = 5 - Variable = 6 - Class = 7 - Interface = 8 - Module = 9 - Property = 10 - Unit = 11 - Value = 12 - Enum = 13 - Keyword = 14 - Snippet = 15 - Color = 16 - File = 17 - Reference = 18 - Folder = 19 - EnumMember = 20 - Constant = 21 - Struct = 22 - Event = 23 - Operator = 24 - TypeParameter = 25 - - -@enum.unique -class CompletionItemTag(int, enum.Enum): - """Completion item tags are extra annotations that tweak the rendering of a completion - item. - - @since 3.15.0""" - - # Since: 3.15.0 - Deprecated = 1 - """Render a completion as obsolete, usually using a strike-out.""" - - -@enum.unique -class InsertTextFormat(int, enum.Enum): - """Defines whether the insert text in a completion item should be interpreted as - plain text or a snippet.""" - - PlainText = 1 - """The primary text to be inserted is treated as a plain string.""" - Snippet = 2 - """The primary text to be inserted is treated as a snippet. - - A snippet can define tab stops and placeholders with `$1`, `$2` - and `${3:foo}`. `$0` defines the final tab stop, it defaults to - the end of the snippet. Placeholders with equal identifiers are linked, - that is typing in one will update others too. - - See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax""" - - -@enum.unique -class InsertTextMode(int, enum.Enum): - """How whitespace and indentation is handled during completion - item insertion. - - @since 3.16.0""" - - # Since: 3.16.0 - AsIs = 1 - """The insertion or replace strings is taken as it is. If the - value is multi line the lines below the cursor will be - inserted using the indentation defined in the string value. - The client will not apply any kind of adjustments to the - string.""" - AdjustIndentation = 2 - """The editor adjusts leading whitespace of new lines so that - they match the indentation up to the cursor of the line for - which the item is accepted. - - Consider a line like this: <2tabs><3tabs>foo. Accepting a - multi line completion item is indented using 2 tabs and all - following lines inserted will be indented using 2 tabs as well.""" - - -@enum.unique -class DocumentHighlightKind(int, enum.Enum): - """A document highlight kind.""" - - Text = 1 - """A textual occurrence.""" - Read = 2 - """Read-access of a symbol, like reading a variable.""" - Write = 3 - """Write-access of a symbol, like writing to a variable.""" - - -@enum.unique -class CodeActionKind(str, enum.Enum): - """A set of predefined code action kinds""" - - Empty = "" - """Empty kind.""" - QuickFix = "quickfix" - """Base kind for quickfix actions: 'quickfix'""" - Refactor = "refactor" - """Base kind for refactoring actions: 'refactor'""" - RefactorExtract = "refactor.extract" - """Base kind for refactoring extraction actions: 'refactor.extract' - - Example extract actions: - - - Extract method - - Extract function - - Extract variable - - Extract interface from class - - ...""" - RefactorInline = "refactor.inline" - """Base kind for refactoring inline actions: 'refactor.inline' - - Example inline actions: - - - Inline function - - Inline variable - - Inline constant - - ...""" - RefactorRewrite = "refactor.rewrite" - """Base kind for refactoring rewrite actions: 'refactor.rewrite' - - Example rewrite actions: - - - Convert JavaScript function to class - - Add or remove parameter - - Encapsulate field - - Make method static - - Move method to base class - - ...""" - Source = "source" - """Base kind for source actions: `source` - - Source code actions apply to the entire file.""" - SourceOrganizeImports = "source.organizeImports" - """Base kind for an organize imports source action: `source.organizeImports`""" - SourceFixAll = "source.fixAll" - """Base kind for auto-fix source actions: `source.fixAll`. - - Fix all actions automatically fix errors that have a clear fix that do not require user input. - They should not suppress errors or perform unsafe fixes such as generating new types or classes. - - @since 3.15.0""" - # Since: 3.15.0 - - -@enum.unique -class TraceValues(str, enum.Enum): - Off = "off" - """Turn tracing off.""" - Messages = "messages" - """Trace messages only.""" - Verbose = "verbose" - """Verbose message tracing.""" - - -@enum.unique -class MarkupKind(str, enum.Enum): - """Describes the content type that a client supports in various - result literals like `Hover`, `ParameterInfo` or `CompletionItem`. - - Please note that `MarkupKinds` must not start with a `$`. This kinds - are reserved for internal usage.""" - - PlainText = "plaintext" - """Plain text is supported as a content format""" - Markdown = "markdown" - """Markdown is supported as a content format""" - - -@enum.unique -class InlineCompletionTriggerKind(int, enum.Enum): - """Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - Invoked = 0 - """Completion was triggered explicitly by a user gesture.""" - Automatic = 1 - """Completion was triggered automatically while editing.""" - - -@enum.unique -class PositionEncodingKind(str, enum.Enum): - """A set of predefined position encoding kinds. - - @since 3.17.0""" - - # Since: 3.17.0 - Utf8 = "utf-8" - """Character offsets count UTF-8 code units (e.g. bytes).""" - Utf16 = "utf-16" - """Character offsets count UTF-16 code units. - - This is the default and must always be supported - by servers""" - Utf32 = "utf-32" - """Character offsets count UTF-32 code units. - - Implementation note: these are the same as Unicode codepoints, - so this `PositionEncodingKind` may also be used for an - encoding-agnostic representation of character offsets.""" - - -@enum.unique -class FileChangeType(int, enum.Enum): - """The file event type""" - - Created = 1 - """The file got created.""" - Changed = 2 - """The file got changed.""" - Deleted = 3 - """The file got deleted.""" - - -@enum.unique -class WatchKind(int, enum.Enum): - Create = 1 - """Interested in create events.""" - Change = 2 - """Interested in change events""" - Delete = 4 - """Interested in delete events""" - - -@enum.unique -class DiagnosticSeverity(int, enum.Enum): - """The diagnostic's severity.""" - - Error = 1 - """Reports an error.""" - Warning = 2 - """Reports a warning.""" - Information = 3 - """Reports an information.""" - Hint = 4 - """Reports a hint.""" - - -@enum.unique -class DiagnosticTag(int, enum.Enum): - """The diagnostic tags. - - @since 3.15.0""" - - # Since: 3.15.0 - Unnecessary = 1 - """Unused or unnecessary code. - - Clients are allowed to render diagnostics with this tag faded out instead of having - an error squiggle.""" - Deprecated = 2 - """Deprecated or obsolete code. - - Clients are allowed to rendered diagnostics with this tag strike through.""" - - -@enum.unique -class CompletionTriggerKind(int, enum.Enum): - """How a completion was triggered""" - - Invoked = 1 - """Completion was triggered by typing an identifier (24x7 code - complete), manual invocation (e.g Ctrl+Space) or via API.""" - TriggerCharacter = 2 - """Completion was triggered by a trigger character specified by - the `triggerCharacters` properties of the `CompletionRegistrationOptions`.""" - TriggerForIncompleteCompletions = 3 - """Completion was re-triggered as current completion list is incomplete""" - - -@enum.unique -class SignatureHelpTriggerKind(int, enum.Enum): - """How a signature help was triggered. - - @since 3.15.0""" - - # Since: 3.15.0 - Invoked = 1 - """Signature help was invoked manually by the user or by a command.""" - TriggerCharacter = 2 - """Signature help was triggered by a trigger character.""" - ContentChange = 3 - """Signature help was triggered by the cursor moving or by the document content changing.""" - - -@enum.unique -class CodeActionTriggerKind(int, enum.Enum): - """The reason why code actions were requested. - - @since 3.17.0""" - - # Since: 3.17.0 - Invoked = 1 - """Code actions were explicitly requested by the user or by an extension.""" - Automatic = 2 - """Code actions were requested automatically. - - This typically happens when current selection in a file changes, but can - also be triggered when file content changes.""" - - -@enum.unique -class FileOperationPatternKind(str, enum.Enum): - """A pattern kind describing if a glob pattern matches a file a folder or - both. - - @since 3.16.0""" - - # Since: 3.16.0 - File = "file" - """The pattern matches a file only.""" - Folder = "folder" - """The pattern matches a folder only.""" - - -@enum.unique -class NotebookCellKind(int, enum.Enum): - """A notebook cell kind. - - @since 3.17.0""" - - # Since: 3.17.0 - Markup = 1 - """A markup-cell is formatted source that is used for display.""" - Code = 2 - """A code-cell is source code.""" - - -@enum.unique -class ResourceOperationKind(str, enum.Enum): - Create = "create" - """Supports creating new files and folders.""" - Rename = "rename" - """Supports renaming existing files and folders.""" - Delete = "delete" - """Supports deleting existing files and folders.""" - - -@enum.unique -class FailureHandlingKind(str, enum.Enum): - Abort = "abort" - """Applying the workspace change is simply aborted if one of the changes provided - fails. All operations executed before the failing operation stay executed.""" - Transactional = "transactional" - """All operations are executed transactional. That means they either all - succeed or no changes at all are applied to the workspace.""" - TextOnlyTransactional = "textOnlyTransactional" - """If the workspace edit contains only textual file changes they are executed transactional. - If resource changes (create, rename or delete file) are part of the change the failure - handling strategy is abort.""" - Undo = "undo" - """The client tries to undo the operations already executed. But there is no - guarantee that this is succeeding.""" - - -@enum.unique -class PrepareSupportDefaultBehavior(int, enum.Enum): - Identifier = 1 - """The client's default behavior is to select the identifier - according the to language's syntax rule.""" - - -@enum.unique -class TokenFormat(str, enum.Enum): - Relative = "relative" - - -class LSPObject: - """LSP object definition. - @since 3.17.0""" - - # Since: 3.17.0 - pass - - -Definition = Union["Location", Sequence["Location"]] -"""The definition of a symbol represented as one or many {@link Location locations}. -For most programming languages there is only one location at which a symbol is -defined. - -Servers should prefer returning `DefinitionLink` over `Definition` if supported -by the client.""" - - -DefinitionLink = TypeAlias["LocationLink"] -"""Information about where a symbol is defined. - -Provides additional metadata over normal {@link Location location} definitions, including the range of -the defining symbol""" - - -LSPArray = Sequence["LSPAny"] -"""LSP arrays. -@since 3.17.0""" -# Since: 3.17.0 - - -LSPAny = Union[Any, None] -"""The LSP any type. -Please note that strictly speaking a property with the value `undefined` -can't be converted into JSON preserving the property name. However for -convenience it is allowed and assumed that all these properties are -optional as well. -@since 3.17.0""" -# Since: 3.17.0 - - -Declaration = Union["Location", Sequence["Location"]] -"""The declaration of a symbol representation as one or many {@link Location locations}.""" - - -DeclarationLink = TypeAlias["LocationLink"] -"""Information about where a symbol is declared. - -Provides additional metadata over normal {@link Location location} declarations, including the range of -the declaring symbol. - -Servers should prefer returning `DeclarationLink` over `Declaration` if supported -by the client.""" - - -InlineValue = Union[ - "InlineValueText", "InlineValueVariableLookup", "InlineValueEvaluatableExpression" -] -"""Inline value information can be provided by different means: -- directly as a text value (class InlineValueText). -- as a name to use for a variable lookup (class InlineValueVariableLookup) -- as an evaluatable expression (class InlineValueEvaluatableExpression) -The InlineValue types combines all inline value types into one type. - -@since 3.17.0""" -# Since: 3.17.0 - - -DocumentDiagnosticReport = Union[ - "RelatedFullDocumentDiagnosticReport", "RelatedUnchangedDocumentDiagnosticReport" -] -"""The result of a document diagnostic pull request. A report can -either be a full report containing all diagnostics for the -requested document or an unchanged report indicating that nothing -has changed in terms of diagnostics in comparison to the last -pull request. - -@since 3.17.0""" -# Since: 3.17.0 - - -PrepareRenameResult = Union[ - "Range", "PrepareRenamePlaceholder", "PrepareRenameDefaultBehavior" -] - - -DocumentSelector = Sequence["DocumentFilter"] -"""A document selector is the combination of one or many document filters. - -@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**/tsconfig.json' }]`; - -The use of a string as a document filter is deprecated @since 3.16.0.""" -# Since: 3.16.0. - - -ProgressToken = Union[int, str] - - -ChangeAnnotationIdentifier = str -"""An identifier to refer to a change annotation stored with a workspace edit.""" - - -WorkspaceDocumentDiagnosticReport = Union[ - "WorkspaceFullDocumentDiagnosticReport", - "WorkspaceUnchangedDocumentDiagnosticReport", -] -"""A workspace diagnostic document report. - -@since 3.17.0""" -# Since: 3.17.0 - - -TextDocumentContentChangeEvent = Union[ - "TextDocumentContentChangePartial", "TextDocumentContentChangeWholeDocument" -] -"""An event describing a change to a text document. If only a text is provided -it is considered to be the full content of the document.""" - - -MarkedString = Union[str, "MarkedStringWithLanguage"] -"""MarkedString can be used to render human readable text. It is either a markdown string -or a code-block that provides a language and a code snippet. The language identifier -is semantically equal to the optional language identifier in fenced code blocks in GitHub -issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting - -The pair of a language and a value is an equivalent to markdown: -```${language} -${value} -``` - -Note that markdown strings will be sanitized - that means html will be escaped. -@deprecated use MarkupContent instead.""" - - -DocumentFilter = Union["TextDocumentFilter", "NotebookCellTextDocumentFilter"] -"""A document filter describes a top level text document or -a notebook cell document. - -@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.""" -# Since: 3.17.0 - proposed support for NotebookCellTextDocumentFilter. - - -GlobPattern = Union["Pattern", "RelativePattern"] -"""The glob pattern. Either a string pattern or a relative pattern. - -@since 3.17.0""" -# Since: 3.17.0 - - -TextDocumentFilter = Union[ - "TextDocumentFilterLanguage", - "TextDocumentFilterScheme", - "TextDocumentFilterPattern", -] -"""A document filter denotes a document by different properties like -the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of -its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}. - -Glob patterns can have the following syntax: -- `*` to match one or more characters in a path segment -- `?` to match on one character in a path segment -- `**` to match any number of path segments, including none -- `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files) -- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) -- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) - -@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` -@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }` - -@since 3.17.0""" -# Since: 3.17.0 - - -Pattern = str -"""The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: -- `*` to match one or more characters in a path segment -- `?` to match on one character in a path segment -- `**` to match any number of path segments, including none -- `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files) -- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) -- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) - -@since 3.17.0""" -# Since: 3.17.0 - - -NotebookDocumentFilter = Union[ - "NotebookDocumentFilterNotebookType", - "NotebookDocumentFilterScheme", - "NotebookDocumentFilterPattern", -] -"""A notebook document filter denotes a notebook document by -different properties. The properties will be match -against the notebook's URI (same as with documents) - -@since 3.17.0""" -# Since: 3.17.0 - - -@attrs.define -class TextDocumentPositionParams: - """A parameter literal used in requests to pass a text document and a position inside that - document.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - -@attrs.define -class WorkDoneProgressParams: - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class PartialResultParams: - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class ImplementationParams: - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class Location: - """Represents a location inside a resource, such as a line - inside a text file.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - - range: "Range" = attrs.field() - - def __eq__(self, o: object) -> bool: - if not isinstance(o, Location): - return NotImplemented - return (self.uri == o.uri) and (self.range == o.range) - - def __repr__(self) -> str: - return f"{self.uri}:{self.range!r}" - - -@attrs.define -class TextDocumentRegistrationOptions: - """General text document registration options.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - -@attrs.define -class WorkDoneProgressOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class ImplementationOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class StaticRegistrationOptions: - """Static registration options to be returned in the initialize - request.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class ImplementationRegistrationOptions: - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class TypeDefinitionParams: - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class TypeDefinitionOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class TypeDefinitionRegistrationOptions: - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class WorkspaceFolder: - """A workspace folder inside a client.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The associated URI for this workspace folder.""" - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of the workspace folder. Used to refer to this - workspace folder in the user interface.""" - - -@attrs.define -class DidChangeWorkspaceFoldersParams: - """The parameters of a `workspace/didChangeWorkspaceFolders` notification.""" - - event: "WorkspaceFoldersChangeEvent" = attrs.field() - """The actual workspace folder change event.""" - - -@attrs.define -class ConfigurationParams: - """The parameters of a configuration request.""" - - items: Sequence["ConfigurationItem"] = attrs.field() - - -@attrs.define -class DocumentColorParams: - """Parameters for a {@link DocumentColorRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class ColorInformation: - """Represents a color range from a document.""" - - range: "Range" = attrs.field() - """The range in the document where this color appears.""" - - color: "Color" = attrs.field() - """The actual color value for this color range.""" - - -@attrs.define -class DocumentColorOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentColorRegistrationOptions: - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class ColorPresentationParams: - """Parameters for a {@link ColorPresentationRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - color: "Color" = attrs.field() - """The color to request presentations for.""" - - range: "Range" = attrs.field() - """The range where the color would be inserted. Serves as a context.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class ColorPresentation: - label: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The label of this color presentation. It will be shown on the color - picker header. By default this is also the text that is inserted when selecting - this color presentation.""" - - text_edit: Optional["TextEdit"] = attrs.field(default=None) - """An {@link TextEdit edit} which is applied to a document when selecting - this presentation for the color. When `falsy` the {@link ColorPresentation.label label} - is used.""" - - additional_text_edits: Optional[Sequence["TextEdit"]] = attrs.field(default=None) - """An optional array of additional {@link TextEdit text edits} that are applied when - selecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves.""" - - -@attrs.define -class FoldingRangeParams: - """Parameters for a {@link FoldingRangeRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class FoldingRange: - """Represents a folding range. To be valid, start and end line must be bigger than zero and smaller - than the number of lines in the document. Clients are free to ignore invalid ranges. - """ - - start_line: int = attrs.field(validator=validators.uinteger_validator) - """The zero-based start line of the range to fold. The folded area starts after the line's last character. - To be valid, the end must be zero or larger and smaller than the number of lines in the document.""" - - end_line: int = attrs.field(validator=validators.uinteger_validator) - """The zero-based end line of the range to fold. The folded area ends with the line's last character. - To be valid, the end must be zero or larger and smaller than the number of lines in the document.""" - - start_character: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.""" - - end_character: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.""" - - kind: Optional[Union[FoldingRangeKind, str]] = attrs.field(default=None) - """Describes the kind of the folding range such as `comment' or 'region'. The kind - is used to categorize folding ranges and used by commands like 'Fold all comments'. - See {@link FoldingRangeKind} for an enumeration of standardized kinds.""" - - collapsed_text: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The text that the client should show when the specified range is - collapsed. If not defined or not supported by the client, a default - will be chosen by the client. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class FoldingRangeOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class FoldingRangeRegistrationOptions: - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class DeclarationParams: - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class DeclarationOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DeclarationRegistrationOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class SelectionRangeParams: - """A parameter literal used in selection range requests.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - positions: Sequence["Position"] = attrs.field() - """The positions inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class SelectionRange: - """A selection range represents a part of a selection hierarchy. A selection range - may have a parent selection range that contains it.""" - - range: "Range" = attrs.field() - """The {@link Range range} of this selection range.""" - - parent: Optional["SelectionRange"] = attrs.field(default=None) - """The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.""" - - -@attrs.define -class SelectionRangeOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class SelectionRangeRegistrationOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class WorkDoneProgressCreateParams: - token: ProgressToken = attrs.field() - """The token to be used to report progress.""" - - -@attrs.define -class WorkDoneProgressCancelParams: - token: ProgressToken = attrs.field() - """The token to be used to report progress.""" - - -@attrs.define -class CallHierarchyPrepareParams: - """The parameter of a `textDocument/prepareCallHierarchy` request. - - @since 3.16.0""" - - # Since: 3.16.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class CallHierarchyItem: - """Represents programming constructs like functions or constructors in the context - of call hierarchy. - - @since 3.16.0""" - - # Since: 3.16.0 - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of this item.""" - - kind: SymbolKind = attrs.field() - """The kind of this item.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The resource identifier of this item.""" - - range: "Range" = attrs.field() - """The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.""" - - selection_range: "Range" = attrs.field() - """The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. - Must be contained by the {@link CallHierarchyItem.range `range`}.""" - - tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) - """Tags for this item.""" - - detail: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """More detail for this item, e.g. the signature of a function.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved between a call hierarchy prepare and - incoming calls or outgoing calls requests.""" - - -@attrs.define -class CallHierarchyOptions: - """Call hierarchy options used during static registration. - - @since 3.16.0""" - - # Since: 3.16.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class CallHierarchyRegistrationOptions: - """Call hierarchy options used during static or dynamic registration. - - @since 3.16.0""" - - # Since: 3.16.0 - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class CallHierarchyIncomingCallsParams: - """The parameter of a `callHierarchy/incomingCalls` request. - - @since 3.16.0""" - - # Since: 3.16.0 - - item: CallHierarchyItem = attrs.field() - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class CallHierarchyIncomingCall: - """Represents an incoming call, e.g. a caller of a method or constructor. - - @since 3.16.0""" - - # Since: 3.16.0 - - from_: CallHierarchyItem = attrs.field() - """The item that makes the call.""" - - from_ranges: Sequence["Range"] = attrs.field() - """The ranges at which the calls appear. This is relative to the caller - denoted by {@link CallHierarchyIncomingCall.from `this.from`}.""" - - -@attrs.define -class CallHierarchyOutgoingCallsParams: - """The parameter of a `callHierarchy/outgoingCalls` request. - - @since 3.16.0""" - - # Since: 3.16.0 - - item: CallHierarchyItem = attrs.field() - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class CallHierarchyOutgoingCall: - """Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc. - - @since 3.16.0""" - - # Since: 3.16.0 - - to: CallHierarchyItem = attrs.field() - """The item that is called.""" - - from_ranges: Sequence["Range"] = attrs.field() - """The range at which this item is called. This is the range relative to the caller, e.g the item - passed to {@link CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls `provideCallHierarchyOutgoingCalls`} - and not {@link CallHierarchyOutgoingCall.to `this.to`}.""" - - -@attrs.define -class SemanticTokensParams: - """@since 3.16.0""" - - # Since: 3.16.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class SemanticTokens: - """@since 3.16.0""" - - # Since: 3.16.0 - - data: Sequence[int] = attrs.field() - """The actual tokens.""" - - result_id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional result id. If provided and clients support delta updating - the client will include the result id in the next semantic token request. - A server can then instead of computing all semantic tokens again simply - send a delta.""" - - -@attrs.define -class SemanticTokensPartialResult: - """@since 3.16.0""" - - # Since: 3.16.0 - - data: Sequence[int] = attrs.field() - - -@attrs.define -class SemanticTokensOptions: - """@since 3.16.0""" - - # Since: 3.16.0 - - legend: "SemanticTokensLegend" = attrs.field() - """The legend used by the server""" - - range: Optional[Union[bool, Any]] = attrs.field(default=None) - """Server supports providing semantic tokens for a specific range - of a document.""" - - full: Optional[Union[bool, "SemanticTokensFullDelta"]] = attrs.field(default=None) - """Server supports providing semantic tokens for a full document.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class SemanticTokensRegistrationOptions: - """@since 3.16.0""" - - # Since: 3.16.0 - - legend: "SemanticTokensLegend" = attrs.field() - """The legend used by the server""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - range: Optional[Union[bool, Any]] = attrs.field(default=None) - """Server supports providing semantic tokens for a specific range - of a document.""" - - full: Optional[Union[bool, "SemanticTokensFullDelta"]] = attrs.field(default=None) - """Server supports providing semantic tokens for a full document.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class SemanticTokensDeltaParams: - """@since 3.16.0""" - - # Since: 3.16.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - previous_result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The result id of a previous response. The result Id can either point to a full response - or a delta response depending on what was received last.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class SemanticTokensDelta: - """@since 3.16.0""" - - # Since: 3.16.0 - - edits: Sequence["SemanticTokensEdit"] = attrs.field() - """The semantic token edits to transform a previous result into a new result.""" - - result_id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - - -@attrs.define -class SemanticTokensDeltaPartialResult: - """@since 3.16.0""" - - # Since: 3.16.0 - - edits: Sequence["SemanticTokensEdit"] = attrs.field() - - -@attrs.define -class SemanticTokensRangeParams: - """@since 3.16.0""" - - # Since: 3.16.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - range: "Range" = attrs.field() - """The range the semantic tokens are requested for.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class ShowDocumentParams: - """Params to show a resource in the UI. - - @since 3.16.0""" - - # Since: 3.16.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The uri to show.""" - - external: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Indicates to show the resource in an external program. - To show, for example, `https://code.visualstudio.com/` - in the default WEB browser set `external` to `true`.""" - - take_focus: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """An optional property to indicate whether the editor - showing the document should take focus or not. - Clients might ignore this property if an external - program is started.""" - - selection: Optional["Range"] = attrs.field(default=None) - """An optional selection range if the document is a text - document. Clients might ignore the property if an - external program is started or the file is not a text - file.""" - - -@attrs.define -class ShowDocumentResult: - """The result of a showDocument request. - - @since 3.16.0""" - - # Since: 3.16.0 - - success: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """A boolean indicating if the show was successful.""" - - -@attrs.define -class LinkedEditingRangeParams: - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class LinkedEditingRanges: - """The result of a linked editing range request. - - @since 3.16.0""" - - # Since: 3.16.0 - - ranges: Sequence["Range"] = attrs.field() - """A list of ranges that can be edited together. The ranges must have - identical length and contain identical text content. The ranges cannot overlap.""" - - word_pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional word pattern (regular expression) that describes valid contents for - the given ranges. If no pattern is provided, the client configuration's word - pattern will be used.""" - - -@attrs.define -class LinkedEditingRangeOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class LinkedEditingRangeRegistrationOptions: - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class CreateFilesParams: - """The parameters sent in notifications/requests for user-initiated creation of - files. - - @since 3.16.0""" - - # Since: 3.16.0 - - files: Sequence["FileCreate"] = attrs.field() - """An array of all files/folders created in this operation.""" - - -@attrs.define -class WorkspaceEdit: - """A workspace edit represents changes to many resources managed in the workspace. The edit - should either provide `changes` or `documentChanges`. If documentChanges are present - they are preferred over `changes` if the client can handle versioned document edits. - - Since version 3.13.0 a workspace edit can contain resource operations as well. If resource - operations are present clients need to execute the operations in the order in which they - are provided. So a workspace edit for example can consist of the following two changes: - (1) a create file a.txt and (2) a text document edit which insert text into file a.txt. - - An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will - cause failure of the operation. How the client recovers from the failure is described by - the client capability: `workspace.workspaceEdit.failureHandling`""" - - changes: Optional[Dict[str, Sequence["TextEdit"]]] = attrs.field(default=None) - """Holds changes to existing resources.""" - - document_changes: Optional[ - Sequence[Union["TextDocumentEdit", "CreateFile", "RenameFile", "DeleteFile"]] - ] = attrs.field(default=None) - """Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes - are either an array of `TextDocumentEdit`s to express changes to n different text documents - where each text document edit addresses a specific version of a text document. Or it can contain - above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations. - - Whether a client supports versioned document edits is expressed via - `workspace.workspaceEdit.documentChanges` client capability. - - If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then - only plain `TextEdit`s using the `changes` property are supported.""" - - change_annotations: Optional[ - Dict[ChangeAnnotationIdentifier, "ChangeAnnotation"] - ] = attrs.field(default=None) - """A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and - delete file / folder operations. - - Whether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class FileOperationRegistrationOptions: - """The options to register for file operations. - - @since 3.16.0""" - - # Since: 3.16.0 - - filters: Sequence["FileOperationFilter"] = attrs.field() - """The actual filters.""" - - -@attrs.define -class RenameFilesParams: - """The parameters sent in notifications/requests for user-initiated renames of - files. - - @since 3.16.0""" - - # Since: 3.16.0 - - files: Sequence["FileRename"] = attrs.field() - """An array of all files/folders renamed in this operation. When a folder is renamed, only - the folder will be included, and not its children.""" - - -@attrs.define -class DeleteFilesParams: - """The parameters sent in notifications/requests for user-initiated deletes of - files. - - @since 3.16.0""" - - # Since: 3.16.0 - - files: Sequence["FileDelete"] = attrs.field() - """An array of all files/folders deleted in this operation.""" - - -@attrs.define -class MonikerParams: - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class Moniker: - """Moniker definition to match LSIF 0.5 moniker definition. - - @since 3.16.0""" - - # Since: 3.16.0 - - scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The scheme of the moniker. For example tsc or .Net""" - - identifier: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The identifier of the moniker. The value is opaque in LSIF however - schema owners are allowed to define the structure if they want.""" - - unique: UniquenessLevel = attrs.field() - """The scope in which the moniker is unique""" - - kind: Optional[MonikerKind] = attrs.field(default=None) - """The moniker kind if known.""" - - -@attrs.define -class MonikerOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class MonikerRegistrationOptions: - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class TypeHierarchyPrepareParams: - """The parameter of a `textDocument/prepareTypeHierarchy` request. - - @since 3.17.0""" - - # Since: 3.17.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class TypeHierarchyItem: - """@since 3.17.0""" - - # Since: 3.17.0 - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of this item.""" - - kind: SymbolKind = attrs.field() - """The kind of this item.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The resource identifier of this item.""" - - range: "Range" = attrs.field() - """The range enclosing this symbol not including leading/trailing whitespace - but everything else, e.g. comments and code.""" - - selection_range: "Range" = attrs.field() - """The range that should be selected and revealed when this symbol is being - picked, e.g. the name of a function. Must be contained by the - {@link TypeHierarchyItem.range `range`}.""" - - tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) - """Tags for this item.""" - - detail: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """More detail for this item, e.g. the signature of a function.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved between a type hierarchy prepare and - supertypes or subtypes requests. It could also be used to identify the - type hierarchy in the server, helping improve the performance on - resolving supertypes and subtypes.""" - - -@attrs.define -class TypeHierarchyOptions: - """Type hierarchy options used during static registration. - - @since 3.17.0""" - - # Since: 3.17.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class TypeHierarchyRegistrationOptions: - """Type hierarchy options used during static or dynamic registration. - - @since 3.17.0""" - - # Since: 3.17.0 - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class TypeHierarchySupertypesParams: - """The parameter of a `typeHierarchy/supertypes` request. - - @since 3.17.0""" - - # Since: 3.17.0 - - item: TypeHierarchyItem = attrs.field() - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class TypeHierarchySubtypesParams: - """The parameter of a `typeHierarchy/subtypes` request. - - @since 3.17.0""" - - # Since: 3.17.0 - - item: TypeHierarchyItem = attrs.field() - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class InlineValueParams: - """A parameter literal used in inline value requests. - - @since 3.17.0""" - - # Since: 3.17.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - range: "Range" = attrs.field() - """The document range for which inline values should be computed.""" - - context: "InlineValueContext" = attrs.field() - """Additional information about the context in which inline values were - requested.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class InlineValueOptions: - """Inline value options used during static registration. - - @since 3.17.0""" - - # Since: 3.17.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class InlineValueRegistrationOptions: - """Inline value options used during static or dynamic registration. - - @since 3.17.0""" - - # Since: 3.17.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class InlayHintParams: - """A parameter literal used in inlay hint requests. - - @since 3.17.0""" - - # Since: 3.17.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - range: "Range" = attrs.field() - """The document range for which inlay hints should be computed.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class InlayHint: - """Inlay hint information. - - @since 3.17.0""" - - # Since: 3.17.0 - - position: "Position" = attrs.field() - """The position of this hint.""" - - label: Union[str, Sequence["InlayHintLabelPart"]] = attrs.field() - """The label of this hint. A human readable string or an array of - InlayHintLabelPart label parts. - - *Note* that neither the string nor the label part can be empty.""" - - kind: Optional[InlayHintKind] = attrs.field(default=None) - """The kind of this hint. Can be omitted in which case the client - should fall back to a reasonable default.""" - - text_edits: Optional[Sequence["TextEdit"]] = attrs.field(default=None) - """Optional text edits that are performed when accepting this inlay hint. - - *Note* that edits are expected to change the document so that the inlay - hint (or its nearest variant) is now part of the document and the inlay - hint itself is now obsolete.""" - - tooltip: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) - """The tooltip text when you hover over this item.""" - - padding_left: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Render padding before the hint. - - Note: Padding should use the editor's background color, not the - background color of the hint itself. That means padding can be used - to visually align/separate an inlay hint.""" - - padding_right: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Render padding after the hint. - - Note: Padding should use the editor's background color, not the - background color of the hint itself. That means padding can be used - to visually align/separate an inlay hint.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on an inlay hint between - a `textDocument/inlayHint` and a `inlayHint/resolve` request.""" - - -@attrs.define -class InlayHintOptions: - """Inlay hint options used during static registration. - - @since 3.17.0""" - - # Since: 3.17.0 - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for an inlay hint item.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class InlayHintRegistrationOptions: - """Inlay hint options used during static or dynamic registration. - - @since 3.17.0""" - - # Since: 3.17.0 - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for an inlay hint item.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class DocumentDiagnosticParams: - """Parameters of the document diagnostic request. - - @since 3.17.0""" - - # Since: 3.17.0 - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - identifier: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The additional identifier provided during registration.""" - - previous_result_id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The result id of a previous response if provided.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class DocumentDiagnosticReportPartialResult: - """A partial result for a document diagnostic report. - - @since 3.17.0""" - - # Since: 3.17.0 - - related_documents: Dict[ - str, Union["FullDocumentDiagnosticReport", "UnchangedDocumentDiagnosticReport"] - ] = attrs.field() - - -@attrs.define -class DiagnosticServerCancellationData: - """Cancellation data returned from a diagnostic request. - - @since 3.17.0""" - - # Since: 3.17.0 - - retrigger_request: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - - -@attrs.define -class DiagnosticOptions: - """Diagnostic options. - - @since 3.17.0""" - - # Since: 3.17.0 - - inter_file_dependencies: bool = attrs.field( - validator=attrs.validators.instance_of(bool) - ) - """Whether the language has inter file dependencies meaning that - editing code in one file can result in a different diagnostic - set in another file. Inter file dependencies are common for - most programming languages and typically uncommon for linters.""" - - workspace_diagnostics: bool = attrs.field( - validator=attrs.validators.instance_of(bool) - ) - """The server provides support for workspace diagnostics as well.""" - - identifier: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional identifier under which the diagnostics are - managed by the client.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DiagnosticRegistrationOptions: - """Diagnostic registration options. - - @since 3.17.0""" - - # Since: 3.17.0 - - inter_file_dependencies: bool = attrs.field( - validator=attrs.validators.instance_of(bool) - ) - """Whether the language has inter file dependencies meaning that - editing code in one file can result in a different diagnostic - set in another file. Inter file dependencies are common for - most programming languages and typically uncommon for linters.""" - - workspace_diagnostics: bool = attrs.field( - validator=attrs.validators.instance_of(bool) - ) - """The server provides support for workspace diagnostics as well.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - identifier: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional identifier under which the diagnostics are - managed by the client.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class WorkspaceDiagnosticParams: - """Parameters of the workspace diagnostic request. - - @since 3.17.0""" - - # Since: 3.17.0 - - previous_result_ids: Sequence["PreviousResultId"] = attrs.field() - """The currently known diagnostic reports with their - previous result ids.""" - - identifier: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The additional identifier provided during registration.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class WorkspaceDiagnosticReport: - """A workspace diagnostic report. - - @since 3.17.0""" - - # Since: 3.17.0 - - items: Sequence[WorkspaceDocumentDiagnosticReport] = attrs.field() - - -@attrs.define -class WorkspaceDiagnosticReportPartialResult: - """A partial result for a workspace diagnostic report. - - @since 3.17.0""" - - # Since: 3.17.0 - - items: Sequence[WorkspaceDocumentDiagnosticReport] = attrs.field() - - -@attrs.define -class DidOpenNotebookDocumentParams: - """The params sent in an open notebook document notification. - - @since 3.17.0""" - - # Since: 3.17.0 - - notebook_document: "NotebookDocument" = attrs.field() - """The notebook document that got opened.""" - - cell_text_documents: Sequence["TextDocumentItem"] = attrs.field() - """The text documents that represent the content - of a notebook cell.""" - - -@attrs.define -class DidChangeNotebookDocumentParams: - """The params sent in a change notebook document notification. - - @since 3.17.0""" - - # Since: 3.17.0 - - notebook_document: "VersionedNotebookDocumentIdentifier" = attrs.field() - """The notebook document that did change. The version number points - to the version after all provided changes have been applied. If - only the text document content of a cell changes the notebook version - doesn't necessarily have to change.""" - - change: "NotebookDocumentChangeEvent" = attrs.field() - """The actual changes to the notebook document. - - The changes describe single state changes to the notebook document. - So if there are two changes c1 (at array index 0) and c2 (at array - index 1) for a notebook in state S then c1 moves the notebook from - S to S' and c2 from S' to S''. So c1 is computed on the state S and - c2 is computed on the state S'. - - To mirror the content of a notebook using change events use the following approach: - - start with the same initial content - - apply the 'notebookDocument/didChange' notifications in the order you receive them. - - apply the `NotebookChangeEvent`s in a single notification in the order - you receive them.""" - - -@attrs.define -class DidSaveNotebookDocumentParams: - """The params sent in a save notebook document notification. - - @since 3.17.0""" - - # Since: 3.17.0 - - notebook_document: "NotebookDocumentIdentifier" = attrs.field() - """The notebook document that got saved.""" - - -@attrs.define -class DidCloseNotebookDocumentParams: - """The params sent in a close notebook document notification. - - @since 3.17.0""" - - # Since: 3.17.0 - - notebook_document: "NotebookDocumentIdentifier" = attrs.field() - """The notebook document that got closed.""" - - cell_text_documents: Sequence["TextDocumentIdentifier"] = attrs.field() - """The text documents that represent the content - of a notebook cell that got closed.""" - - -@attrs.define -class InlineCompletionParams: - """A parameter literal used in inline completion requests. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - context: "InlineCompletionContext" = attrs.field() - """Additional information about the context in which inline completions were - requested.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class InlineCompletionList: - """Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - items: Sequence["InlineCompletionItem"] = attrs.field() - """The inline completion items""" - - -@attrs.define -class InlineCompletionItem: - """An inline completion item represents a text snippet that is proposed inline to complete text that is being typed. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - insert_text: Union[str, "StringValue"] = attrs.field() - """The text to replace the range with. Must be set.""" - - filter_text: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used.""" - - range: Optional["Range"] = attrs.field(default=None) - """The range to replace. Must begin and end on the same line.""" - - command: Optional["Command"] = attrs.field(default=None) - """An optional {@link Command} that is executed *after* inserting this completion.""" - - -@attrs.define -class InlineCompletionOptions: - """Inline completion options used during static registration. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class InlineCompletionRegistrationOptions: - """Inline completion options used during static or dynamic registration. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class RegistrationParams: - registrations: Sequence["Registration"] = attrs.field() - - -@attrs.define -class UnregistrationParams: - unregisterations: Sequence["Unregistration"] = attrs.field() - - -@attrs.define -class _InitializeParams: - """The initialize parameters""" - - capabilities: "ClientCapabilities" = attrs.field() - """The capabilities provided by the client (editor or tool)""" - - process_id: Optional[Union[int, None]] = attrs.field(default=None) - """The process Id of the parent process that started - the server. - - Is `null` if the process has not been started by another process. - If the parent process is not alive then the server should exit.""" - - client_info: Optional["ClientInfo"] = attrs.field(default=None) - """Information about the client - - @since 3.15.0""" - # Since: 3.15.0 - - locale: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The locale the client is currently showing the user interface - in. This must not necessarily be the locale of the operating - system. - - Uses IETF language tags as the value's syntax - (See https://en.wikipedia.org/wiki/IETF_language_tag) - - @since 3.16.0""" - # Since: 3.16.0 - - root_path: Optional[Union[str, None]] = attrs.field(default=None) - """The rootPath of the workspace. Is null - if no folder is open. - - @deprecated in favour of rootUri.""" - - root_uri: Optional[Union[str, None]] = attrs.field(default=None) - """The rootUri of the workspace. Is null if no - folder is open. If both `rootPath` and `rootUri` are set - `rootUri` wins. - - @deprecated in favour of workspaceFolders.""" - - initialization_options: Optional[LSPAny] = attrs.field(default=None) - """User provided initialization options.""" - - trace: Optional[TraceValues] = attrs.field(default=None) - """The initial trace setting. If omitted trace is disabled ('off').""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class WorkspaceFoldersInitializeParams: - workspace_folders: Optional[Union[Sequence[WorkspaceFolder], None]] = attrs.field( - default=None - ) - """The workspace folders configured in the client when the server starts. - - This property is only available if the client supports workspace folders. - It can be `null` if the client supports workspace folders but none are - configured. - - @since 3.6.0""" - # Since: 3.6.0 - - -@attrs.define -class InitializeParams: - capabilities: "ClientCapabilities" = attrs.field() - """The capabilities provided by the client (editor or tool)""" - - process_id: Optional[Union[int, None]] = attrs.field(default=None) - """The process Id of the parent process that started - the server. - - Is `null` if the process has not been started by another process. - If the parent process is not alive then the server should exit.""" - - client_info: Optional["ClientInfo"] = attrs.field(default=None) - """Information about the client - - @since 3.15.0""" - # Since: 3.15.0 - - locale: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The locale the client is currently showing the user interface - in. This must not necessarily be the locale of the operating - system. - - Uses IETF language tags as the value's syntax - (See https://en.wikipedia.org/wiki/IETF_language_tag) - - @since 3.16.0""" - # Since: 3.16.0 - - root_path: Optional[Union[str, None]] = attrs.field(default=None) - """The rootPath of the workspace. Is null - if no folder is open. - - @deprecated in favour of rootUri.""" - - root_uri: Optional[Union[str, None]] = attrs.field(default=None) - """The rootUri of the workspace. Is null if no - folder is open. If both `rootPath` and `rootUri` are set - `rootUri` wins. - - @deprecated in favour of workspaceFolders.""" - - initialization_options: Optional[LSPAny] = attrs.field(default=None) - """User provided initialization options.""" - - trace: Optional[TraceValues] = attrs.field(default=None) - """The initial trace setting. If omitted trace is disabled ('off').""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - workspace_folders: Optional[Union[Sequence[WorkspaceFolder], None]] = attrs.field( - default=None - ) - """The workspace folders configured in the client when the server starts. - - This property is only available if the client supports workspace folders. - It can be `null` if the client supports workspace folders but none are - configured. - - @since 3.6.0""" - # Since: 3.6.0 - - -@attrs.define -class InitializeResult: - """The result returned from an initialize request.""" - - capabilities: "ServerCapabilities" = attrs.field() - """The capabilities the language server provides.""" - - server_info: Optional["ServerInfo"] = attrs.field(default=None) - """Information about the server. - - @since 3.15.0""" - # Since: 3.15.0 - - -@attrs.define -class InitializeError: - """The data type of the ResponseError if the - initialize request fails.""" - - retry: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """Indicates whether the client execute the following retry logic: - (1) show the message provided by the ResponseError to the user - (2) user selects retry or cancel - (3) if user selected retry the initialize method is sent again.""" - - -@attrs.define -class InitializedParams: - pass - - -@attrs.define -class DidChangeConfigurationParams: - """The parameters of a change configuration notification.""" - - settings: LSPAny = attrs.field() - """The actual changed settings""" - - -@attrs.define -class DidChangeConfigurationRegistrationOptions: - section: Optional[Union[str, Sequence[str]]] = attrs.field(default=None) - - -@attrs.define -class ShowMessageParams: - """The parameters of a notification message.""" - - type: MessageType = attrs.field() - """The message type. See {@link MessageType}""" - - message: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The actual message.""" - - -@attrs.define -class ShowMessageRequestParams: - type: MessageType = attrs.field() - """The message type. See {@link MessageType}""" - - message: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The actual message.""" - - actions: Optional[Sequence["MessageActionItem"]] = attrs.field(default=None) - """The message action items to present.""" - - -@attrs.define -class MessageActionItem: - title: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A short title like 'Retry', 'Open Log' etc.""" - - -@attrs.define -class LogMessageParams: - """The log message parameters.""" - - type: MessageType = attrs.field() - """The message type. See {@link MessageType}""" - - message: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The actual message.""" - - -@attrs.define -class DidOpenTextDocumentParams: - """The parameters sent in an open text document notification""" - - text_document: "TextDocumentItem" = attrs.field() - """The document that was opened.""" - - -@attrs.define -class DidChangeTextDocumentParams: - """The change text document notification's parameters.""" - - text_document: "VersionedTextDocumentIdentifier" = attrs.field() - """The document that did change. The version number points - to the version after all provided content changes have - been applied.""" - - content_changes: Sequence[TextDocumentContentChangeEvent] = attrs.field() - """The actual content changes. The content changes describe single state changes - to the document. So if there are two content changes c1 (at array index 0) and - c2 (at array index 1) for a document in state S then c1 moves the document from - S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed - on the state S'. - - To mirror the content of a document using change events use the following approach: - - start with the same initial content - - apply the 'textDocument/didChange' notifications in the order you receive them. - - apply the `TextDocumentContentChangeEvent`s in a single notification in the order - you receive them.""" - - -@attrs.define -class TextDocumentChangeRegistrationOptions: - """Describe options to be used when registered for text document change events.""" - - sync_kind: TextDocumentSyncKind = attrs.field() - """How documents are synced to the server.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - -@attrs.define -class DidCloseTextDocumentParams: - """The parameters sent in a close text document notification""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document that was closed.""" - - -@attrs.define -class DidSaveTextDocumentParams: - """The parameters sent in a save text document notification""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document that was saved.""" - - text: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """Optional the content when saved. Depends on the includeText value - when the save notification was requested.""" - - -@attrs.define -class SaveOptions: - """Save options.""" - - include_text: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client is supposed to include the content on save.""" - - -@attrs.define -class TextDocumentSaveRegistrationOptions: - """Save registration options.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - include_text: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client is supposed to include the content on save.""" - - -@attrs.define -class WillSaveTextDocumentParams: - """The parameters sent in a will save text document notification.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document that will be saved.""" - - reason: TextDocumentSaveReason = attrs.field() - """The 'TextDocumentSaveReason'.""" - - -@attrs.define -class TextEdit: - """A text edit applicable to a text document.""" - - range: "Range" = attrs.field() - """The range of the text document to be manipulated. To insert - text into a document create a range where start === end.""" - - new_text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The string to be inserted. For delete operations use an - empty string.""" - - -@attrs.define -class DidChangeWatchedFilesParams: - """The watched files change notification's parameters.""" - - changes: Sequence["FileEvent"] = attrs.field() - """The actual file events.""" - - -@attrs.define -class DidChangeWatchedFilesRegistrationOptions: - """Describe options to be used when registered for text document change events.""" - - watchers: Sequence["FileSystemWatcher"] = attrs.field() - """The watchers to register.""" - - -@attrs.define -class PublishDiagnosticsParams: - """The publish diagnostic notification's parameters.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The URI for which diagnostic information is reported.""" - - diagnostics: Sequence["Diagnostic"] = attrs.field() - """An array of diagnostic information items.""" - - version: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.integer_validator), default=None - ) - """Optional the version number of the document the diagnostics are published for. - - @since 3.15.0""" - # Since: 3.15.0 - - -@attrs.define -class CompletionParams: - """Completion parameters""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - context: Optional["CompletionContext"] = attrs.field(default=None) - """The completion context. This is only available it the client specifies - to send this using the client capability `textDocument.completion.contextSupport === true`""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class CompletionItem: - """A completion item represents a text snippet that is - proposed to complete text that is being typed.""" - - label: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The label of this completion item. - - The label property is also by default the text that - is inserted when selecting this completion. - - If label details are provided the label itself should - be an unqualified name of the completion item.""" - - label_details: Optional["CompletionItemLabelDetails"] = attrs.field(default=None) - """Additional details for the label - - @since 3.17.0""" - # Since: 3.17.0 - - kind: Optional[CompletionItemKind] = attrs.field(default=None) - """The kind of this completion item. Based of the kind - an icon is chosen by the editor.""" - - tags: Optional[Sequence[CompletionItemTag]] = attrs.field(default=None) - """Tags for this completion item. - - @since 3.15.0""" - # Since: 3.15.0 - - detail: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A human-readable string with additional information - about this item, like type or symbol information.""" - - documentation: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) - """A human-readable string that represents a doc-comment.""" - - deprecated: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Indicates if this item is deprecated. - @deprecated Use `tags` instead.""" - - preselect: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Select this item when showing. - - *Note* that only one completion item can be selected and that the - tool / client decides which item that is. The rule is that the *first* - item of those that match best is selected.""" - - sort_text: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A string that should be used when comparing this item - with other items. When `falsy` the {@link CompletionItem.label label} - is used.""" - - filter_text: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A string that should be used when filtering a set of - completion items. When `falsy` the {@link CompletionItem.label label} - is used.""" - - insert_text: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A string that should be inserted into a document when selecting - this completion. When `falsy` the {@link CompletionItem.label label} - is used. - - The `insertText` is subject to interpretation by the client side. - Some tools might not take the string literally. For example - VS Code when code complete is requested in this example - `con` and a completion item with an `insertText` of - `console` is provided it will only insert `sole`. Therefore it is - recommended to use `textEdit` instead since it avoids additional client - side interpretation.""" - - insert_text_format: Optional[InsertTextFormat] = attrs.field(default=None) - """The format of the insert text. The format applies to both the - `insertText` property and the `newText` property of a provided - `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`. - - Please note that the insertTextFormat doesn't apply to - `additionalTextEdits`.""" - - insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) - """How whitespace and indentation is handled during completion - item insertion. If not provided the clients default value depends on - the `textDocument.completion.insertTextMode` client capability. - - @since 3.16.0""" - # Since: 3.16.0 - - text_edit: Optional[Union[TextEdit, "InsertReplaceEdit"]] = attrs.field( - default=None - ) - """An {@link TextEdit edit} which is applied to a document when selecting - this completion. When an edit is provided the value of - {@link CompletionItem.insertText insertText} is ignored. - - Most editors support two different operations when accepting a completion - item. One is to insert a completion text and the other is to replace an - existing text with a completion text. Since this can usually not be - predetermined by a server it can report both ranges. Clients need to - signal support for `InsertReplaceEdits` via the - `textDocument.completion.insertReplaceSupport` client capability - property. - - *Note 1:* The text edit's range as well as both ranges from an insert - replace edit must be a [single line] and they must contain the position - at which completion has been requested. - *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range - must be a prefix of the edit's replace range, that means it must be - contained and starting at the same position. - - @since 3.16.0 additional type `InsertReplaceEdit`""" - # Since: 3.16.0 additional type `InsertReplaceEdit` - - text_edit_text: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The edit text used if the completion item is part of a CompletionList and - CompletionList defines an item default for the text edit range. - - Clients will only honor this property if they opt into completion list - item defaults using the capability `completionList.itemDefaults`. - - If not provided and a list's default range is provided the label - property is used as a text. - - @since 3.17.0""" - # Since: 3.17.0 - - additional_text_edits: Optional[Sequence[TextEdit]] = attrs.field(default=None) - """An optional array of additional {@link TextEdit text edits} that are applied when - selecting this completion. Edits must not overlap (including the same insert position) - with the main {@link CompletionItem.textEdit edit} nor with themselves. - - Additional text edits should be used to change text unrelated to the current cursor position - (for example adding an import statement at the top of the file if the completion item will - insert an unqualified type).""" - - commit_characters: Optional[Sequence[str]] = attrs.field(default=None) - """An optional set of characters that when pressed while this completion is active will accept it first and - then type that character. *Note* that all commit characters should have `length=1` and that superfluous - characters will be ignored.""" - - command: Optional["Command"] = attrs.field(default=None) - """An optional {@link Command command} that is executed *after* inserting this completion. *Note* that - additional modifications to the current document should be described with the - {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a completion item between a - {@link CompletionRequest} and a {@link CompletionResolveRequest}.""" - - -@attrs.define -<<<<<<< HEAD -class CompletionListItemDefaultsTypeEditRangeType1: - insert: "Range" = attrs.field() - - replace: "Range" = attrs.field() - - -@attrs.define -class CompletionListItemDefaultsType: - commit_characters: Optional[Sequence[str]] = attrs.field(default=None) - """A default commit character set. - - @since 3.17.0""" - # Since: 3.17.0 - - edit_range: Optional[ - Union["Range", "CompletionListItemDefaultsTypeEditRangeType1"] - ] = attrs.field(default=None) - """A default edit range. - - @since 3.17.0""" - # Since: 3.17.0 - - insert_text_format: Optional[InsertTextFormat] = attrs.field(default=None) - """A default insert text format. - - @since 3.17.0""" - # Since: 3.17.0 - - insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) - """A default insert text mode. - - @since 3.17.0""" - # Since: 3.17.0 - - data: Optional[LSPAny] = attrs.field(default=None) - """A default data value. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class CompletionList: - """Represents a collection of {@link CompletionItem completion items} to be presented - in the editor.""" - - is_incomplete: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """This list it not complete. Further typing results in recomputing this list. - - Recomputed lists have all their items replaced (not appended) in the - incomplete completion sessions.""" - - items: Sequence[CompletionItem] = attrs.field() - """The completion items.""" - - item_defaults: Optional["CompletionItemDefaults"] = attrs.field(default=None) - """In many cases the items of an actual completion result share the same - value for properties like `commitCharacters` or the range of a text - edit. A completion list can therefore define item defaults which will - be used if a completion item itself doesn't specify the value. - - If a completion list specifies a default value and a completion item - also specifies a corresponding value the one from the item is used. - - Servers are only allowed to return default values if the client - signals support for this via the `completionList.itemDefaults` - capability. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class CompletionOptions: - """Completion options.""" - - trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) - """Most tools trigger completion request automatically without explicitly requesting - it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user - starts to type an identifier. For example if the user types `c` in a JavaScript file - code complete will automatically pop up present `console` besides others as a - completion item. Characters that make up identifiers don't need to be listed here. - - If code complete should automatically be trigger on characters not being valid inside - an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.""" - - all_commit_characters: Optional[Sequence[str]] = attrs.field(default=None) - """The list of all possible characters that commit a completion. This field can be used - if clients don't support individual commit characters per completion item. See - `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` - - If a server provides both `allCommitCharacters` and commit characters on an individual - completion item the ones on the completion item win. - - @since 3.2.0""" - # Since: 3.2.0 - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for a completion item.""" - - completion_item: Optional["ServerCompletionItemOptions"] = attrs.field(default=None) - """The server supports the following `CompletionItem` specific - capabilities. - - @since 3.17.0""" - # Since: 3.17.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class CompletionRegistrationOptions: - """Registration options for a {@link CompletionRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) - """Most tools trigger completion request automatically without explicitly requesting - it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user - starts to type an identifier. For example if the user types `c` in a JavaScript file - code complete will automatically pop up present `console` besides others as a - completion item. Characters that make up identifiers don't need to be listed here. - - If code complete should automatically be trigger on characters not being valid inside - an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.""" - - all_commit_characters: Optional[Sequence[str]] = attrs.field(default=None) - """The list of all possible characters that commit a completion. This field can be used - if clients don't support individual commit characters per completion item. See - `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` - - If a server provides both `allCommitCharacters` and commit characters on an individual - completion item the ones on the completion item win. - - @since 3.2.0""" - # Since: 3.2.0 - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for a completion item.""" - - completion_item: Optional["ServerCompletionItemOptions"] = attrs.field(default=None) - """The server supports the following `CompletionItem` specific - capabilities. - - @since 3.17.0""" - # Since: 3.17.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class HoverParams: - """Parameters for a {@link HoverRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class Hover: - """The result of a hover request.""" - - contents: Union[ - "MarkupContent", MarkedString, Sequence[MarkedString] - ] = attrs.field() - """The hover's content""" - - range: Optional["Range"] = attrs.field(default=None) - """An optional range inside the text document that is used to - visualize the hover, e.g. by changing the background color.""" - - -@attrs.define -class HoverOptions: - """Hover options.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class HoverRegistrationOptions: - """Registration options for a {@link HoverRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class SignatureHelpParams: - """Parameters for a {@link SignatureHelpRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - context: Optional["SignatureHelpContext"] = attrs.field(default=None) - """The signature help context. This is only available if the client specifies - to send this using the client capability `textDocument.signatureHelp.contextSupport === true` - - @since 3.15.0""" - # Since: 3.15.0 - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class SignatureHelp: - """Signature help represents the signature of something - callable. There can be multiple signature but only one - active and only one active parameter.""" - - signatures: Sequence["SignatureInformation"] = attrs.field() - """One or more signatures.""" - - active_signature: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The active signature. If omitted or the value lies outside the - range of `signatures` the value defaults to zero or is ignored if - the `SignatureHelp` has no signatures. - - Whenever possible implementors should make an active decision about - the active signature and shouldn't rely on a default value. - - In future version of the protocol this property might become - mandatory to better express this.""" - - active_parameter: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The active parameter of the active signature. If omitted or the value - lies outside the range of `signatures[activeSignature].parameters` - defaults to 0 if the active signature has parameters. If - the active signature has no parameters it is ignored. - In future version of the protocol this property might become - mandatory to better express the active parameter if the - active signature does have any.""" - - -@attrs.define -class SignatureHelpOptions: - """Server Capabilities for a {@link SignatureHelpRequest}.""" - - trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) - """List of characters that trigger signature help automatically.""" - - retrigger_characters: Optional[Sequence[str]] = attrs.field(default=None) - """List of characters that re-trigger signature help. - - These trigger characters are only active when signature help is already showing. All trigger characters - are also counted as re-trigger characters. - - @since 3.15.0""" - # Since: 3.15.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class SignatureHelpRegistrationOptions: - """Registration options for a {@link SignatureHelpRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) - """List of characters that trigger signature help automatically.""" - - retrigger_characters: Optional[Sequence[str]] = attrs.field(default=None) - """List of characters that re-trigger signature help. - - These trigger characters are only active when signature help is already showing. All trigger characters - are also counted as re-trigger characters. - - @since 3.15.0""" - # Since: 3.15.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DefinitionParams: - """Parameters for a {@link DefinitionRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class DefinitionOptions: - """Server Capabilities for a {@link DefinitionRequest}.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DefinitionRegistrationOptions: - """Registration options for a {@link DefinitionRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class ReferenceParams: - """Parameters for a {@link ReferencesRequest}.""" - - context: "ReferenceContext" = attrs.field() - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class ReferenceOptions: - """Reference options.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class ReferenceRegistrationOptions: - """Registration options for a {@link ReferencesRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentHighlightParams: - """Parameters for a {@link DocumentHighlightRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class DocumentHighlight: - """A document highlight is a range inside a text document which deserves - special attention. Usually a document highlight is visualized by changing - the background color of its range.""" - - range: "Range" = attrs.field() - """The range this highlight applies to.""" - - kind: Optional[DocumentHighlightKind] = attrs.field(default=None) - """The highlight kind, default is {@link DocumentHighlightKind.Text text}.""" - - -@attrs.define -class DocumentHighlightOptions: - """Provider options for a {@link DocumentHighlightRequest}.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentHighlightRegistrationOptions: - """Registration options for a {@link DocumentHighlightRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentSymbolParams: - """Parameters for a {@link DocumentSymbolRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class BaseSymbolInformation: - """A base for all symbol information.""" - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of this symbol.""" - - kind: SymbolKind = attrs.field() - """The kind of this symbol.""" - - tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) - """Tags for this symbol. - - @since 3.16.0""" - # Since: 3.16.0 - - container_name: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The name of the symbol containing this symbol. This information is for - user interface purposes (e.g. to render a qualifier in the user interface - if necessary). It can't be used to re-infer a hierarchy for the document - symbols.""" - - -@attrs.define -class SymbolInformation: - """Represents information about programming constructs like variables, classes, - interfaces etc.""" - - location: Location = attrs.field() - """The location of this symbol. The location's range is used by a tool - to reveal the location in the editor. If the symbol is selected in the - tool the range's start information is used to position the cursor. So - the range usually spans more than the actual symbol's name and does - normally include things like visibility modifiers. - - The range doesn't have to denote a node range in the sense of an abstract - syntax tree. It can therefore not be used to re-construct a hierarchy of - the symbols.""" - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of this symbol.""" - - kind: SymbolKind = attrs.field() - """The kind of this symbol.""" - - deprecated: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Indicates if this symbol is deprecated. - - @deprecated Use tags instead""" - - tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) - """Tags for this symbol. - - @since 3.16.0""" - # Since: 3.16.0 - - container_name: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The name of the symbol containing this symbol. This information is for - user interface purposes (e.g. to render a qualifier in the user interface - if necessary). It can't be used to re-infer a hierarchy for the document - symbols.""" - - -@attrs.define -class DocumentSymbol: - """Represents programming constructs like variables, classes, interfaces etc. - that appear in a document. Document symbols can be hierarchical and they - have two ranges: one that encloses its definition and one that points to - its most interesting range, e.g. the range of an identifier.""" - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of this symbol. Will be displayed in the user interface and therefore must not be - an empty string or a string only consisting of white spaces.""" - - kind: SymbolKind = attrs.field() - """The kind of this symbol.""" - - range: "Range" = attrs.field() - """The range enclosing this symbol not including leading/trailing whitespace but everything else - like comments. This information is typically used to determine if the clients cursor is - inside the symbol to reveal in the symbol in the UI.""" - - selection_range: "Range" = attrs.field() - """The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. - Must be contained by the `range`.""" - - detail: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) - """Tags for this document symbol. - - @since 3.16.0""" - # Since: 3.16.0 - - deprecated: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Indicates if this symbol is deprecated. - - @deprecated Use tags instead""" - - children: Optional[Sequence["DocumentSymbol"]] = attrs.field(default=None) - """Children of this symbol, e.g. properties of a class.""" - - -@attrs.define -class DocumentSymbolOptions: - """Provider options for a {@link DocumentSymbolRequest}.""" - - label: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A human-readable string that is shown when multiple outlines trees - are shown for the same document. - - @since 3.16.0""" - # Since: 3.16.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentSymbolRegistrationOptions: - """Registration options for a {@link DocumentSymbolRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - label: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A human-readable string that is shown when multiple outlines trees - are shown for the same document. - - @since 3.16.0""" - # Since: 3.16.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class CodeActionParams: - """The parameters of a {@link CodeActionRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document in which the command was invoked.""" - - range: "Range" = attrs.field() - """The range for which the command was invoked.""" - - context: "CodeActionContext" = attrs.field() - """Context carrying additional information.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class Command: - """Represents a reference to a command. Provides a title which - will be used to represent a command in the UI and, optionally, - an array of arguments which will be passed to the command handler - function when invoked.""" - - title: str = attrs.field(validator=attrs.validators.instance_of(str)) - """Title of the command, like `save`.""" - - command: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The identifier of the actual command handler.""" - - arguments: Optional[Sequence[LSPAny]] = attrs.field(default=None) - """Arguments that the command handler should be - invoked with.""" - - -@attrs.define -class CodeAction: - """A code action represents a change that can be performed in code, e.g. to fix a problem or - to refactor code. - - A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed. - """ - - title: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A short, human-readable, title for this code action.""" - - kind: Optional[Union[CodeActionKind, str]] = attrs.field(default=None) - """The kind of the code action. - - Used to filter code actions.""" - - diagnostics: Optional[Sequence["Diagnostic"]] = attrs.field(default=None) - """The diagnostics that this code action resolves.""" - - is_preferred: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted - by keybindings. - - A quick fix should be marked preferred if it properly addresses the underlying error. - A refactoring should be marked preferred if it is the most reasonable choice of actions to take. - - @since 3.15.0""" - # Since: 3.15.0 - - disabled: Optional["CodeActionDisabled"] = attrs.field(default=None) - """Marks that the code action cannot currently be applied. - - Clients should follow the following guidelines regarding disabled code actions: - - - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) - code action menus. - - - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type - of code action, such as refactorings. - - - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) - that auto applies a code action and only disabled code actions are returned, the client should show the user an - error message with `reason` in the editor. - - @since 3.16.0""" - # Since: 3.16.0 - - edit: Optional[WorkspaceEdit] = attrs.field(default=None) - """The workspace edit this code action performs.""" - - command: Optional[Command] = attrs.field(default=None) - """A command this code action executes. If a code action - provides an edit and a command, first the edit is - executed and then the command.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a code action between - a `textDocument/codeAction` and a `codeAction/resolve` request. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class CodeActionOptions: - """Provider options for a {@link CodeActionRequest}.""" - - code_action_kinds: Optional[Sequence[Union[CodeActionKind, str]]] = attrs.field( - default=None - ) - """CodeActionKinds that this server may return. - - The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server - may list out every specific kind they provide.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for a code action. - - @since 3.16.0""" - # Since: 3.16.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class CodeActionRegistrationOptions: - """Registration options for a {@link CodeActionRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - code_action_kinds: Optional[Sequence[Union[CodeActionKind, str]]] = attrs.field( - default=None - ) - """CodeActionKinds that this server may return. - - The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server - may list out every specific kind they provide.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for a code action. - - @since 3.16.0""" - # Since: 3.16.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class WorkspaceSymbolParams: - """The parameters of a {@link WorkspaceSymbolRequest}.""" - - query: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A query string to filter symbols by. Clients may send an empty - string here to request all symbols.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class WorkspaceSymbol: - """A special workspace symbol that supports locations without a range. - - See also SymbolInformation. - - @since 3.17.0""" - - # Since: 3.17.0 - - location: Union[Location, "LocationUriOnly"] = attrs.field() - """The location of the symbol. Whether a server is allowed to - return a location without a range depends on the client - capability `workspace.symbol.resolveSupport`. - - See SymbolInformation#location for more details.""" - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of this symbol.""" - - kind: SymbolKind = attrs.field() - """The kind of this symbol.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a workspace symbol between a - workspace symbol request and a workspace symbol resolve request.""" - - tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) - """Tags for this symbol. - - @since 3.16.0""" - # Since: 3.16.0 - - container_name: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The name of the symbol containing this symbol. This information is for - user interface purposes (e.g. to render a qualifier in the user interface - if necessary). It can't be used to re-infer a hierarchy for the document - symbols.""" - - -@attrs.define -class WorkspaceSymbolOptions: - """Server capabilities for a {@link WorkspaceSymbolRequest}.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for a workspace symbol. - - @since 3.17.0""" - # Since: 3.17.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class WorkspaceSymbolRegistrationOptions: - """Registration options for a {@link WorkspaceSymbolRequest}.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server provides support to resolve additional - information for a workspace symbol. - - @since 3.17.0""" - # Since: 3.17.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class CodeLensParams: - """The parameters of a {@link CodeLensRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document to request code lens for.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class CodeLens: - """A code lens represents a {@link Command command} that should be shown along with - source text, like the number of references, a way to run tests, etc. - - A code lens is _unresolved_ when no command is associated to it. For performance - reasons the creation of a code lens and resolving should be done in two stages.""" - - range: "Range" = attrs.field() - """The range in which this code lens is valid. Should only span a single line.""" - - command: Optional[Command] = attrs.field(default=None) - """The command this code lens represents.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a code lens item between - a {@link CodeLensRequest} and a {@link CodeLensResolveRequest}""" - - -@attrs.define -class CodeLensOptions: - """Code Lens provider options of a {@link CodeLensRequest}.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Code lens has a resolve provider as well.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class CodeLensRegistrationOptions: - """Registration options for a {@link CodeLensRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Code lens has a resolve provider as well.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentLinkParams: - """The parameters of a {@link DocumentLinkRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document to provide document links for.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - partial_result_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report partial results (e.g. streaming) to - the client.""" - - -@attrs.define -class DocumentLink: - """A document link is a range in a text document that links to an internal or external resource, like another - text document or a web site.""" - - range: "Range" = attrs.field() - """The range this link applies to.""" - - target: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The uri this link points to. If missing a resolve request is sent later.""" - - tooltip: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The tooltip text when you hover over this link. - - If a tooltip is provided, is will be displayed in a string that includes instructions on how to - trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS, - user settings, and localization. - - @since 3.15.0""" - # Since: 3.15.0 - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a document link between a - DocumentLinkRequest and a DocumentLinkResolveRequest.""" - - -@attrs.define -class DocumentLinkOptions: - """Provider options for a {@link DocumentLinkRequest}.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Document links have a resolve provider as well.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentLinkRegistrationOptions: - """Registration options for a {@link DocumentLinkRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - resolve_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Document links have a resolve provider as well.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentFormattingParams: - """The parameters of a {@link DocumentFormattingRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document to format.""" - - options: "FormattingOptions" = attrs.field() - """The format options.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class DocumentFormattingOptions: - """Provider options for a {@link DocumentFormattingRequest}.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentFormattingRegistrationOptions: - """Registration options for a {@link DocumentFormattingRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentRangeFormattingParams: - """The parameters of a {@link DocumentRangeFormattingRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document to format.""" - - range: "Range" = attrs.field() - """The range to format""" - - options: "FormattingOptions" = attrs.field() - """The format options""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class DocumentRangeFormattingOptions: - """Provider options for a {@link DocumentRangeFormattingRequest}.""" - - ranges_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the server supports formatting multiple ranges at once. - - @since 3.18.0 - @proposed""" - # Since: 3.18.0 - # Proposed - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentRangeFormattingRegistrationOptions: - """Registration options for a {@link DocumentRangeFormattingRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - ranges_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the server supports formatting multiple ranges at once. - - @since 3.18.0 - @proposed""" - # Since: 3.18.0 - # Proposed - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class DocumentRangesFormattingParams: - """The parameters of a {@link DocumentRangesFormattingRequest}. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document to format.""" - - ranges: Sequence["Range"] = attrs.field() - """The ranges to format""" - - options: "FormattingOptions" = attrs.field() - """The format options""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class DocumentOnTypeFormattingParams: - """The parameters of a {@link DocumentOnTypeFormattingRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document to format.""" - - position: "Position" = attrs.field() - """The position around which the on type formatting should happen. - This is not necessarily the exact position where the character denoted - by the property `ch` got typed.""" - - ch: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The character that has been typed that triggered the formatting - on type request. That is not necessarily the last character that - got inserted into the document since the client could auto insert - characters as well (e.g. like automatic brace completion).""" - - options: "FormattingOptions" = attrs.field() - """The formatting options.""" - - -@attrs.define -class DocumentOnTypeFormattingOptions: - """Provider options for a {@link DocumentOnTypeFormattingRequest}.""" - - first_trigger_character: str = attrs.field( - validator=attrs.validators.instance_of(str) - ) - """A character on which formatting should be triggered, like `{`.""" - - more_trigger_character: Optional[Sequence[str]] = attrs.field(default=None) - """More trigger characters.""" - - -@attrs.define -class DocumentOnTypeFormattingRegistrationOptions: - """Registration options for a {@link DocumentOnTypeFormattingRequest}.""" - - first_trigger_character: str = attrs.field( - validator=attrs.validators.instance_of(str) - ) - """A character on which formatting should be triggered, like `{`.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - more_trigger_character: Optional[Sequence[str]] = attrs.field(default=None) - """More trigger characters.""" - - -@attrs.define -class RenameParams: - """The parameters of a {@link RenameRequest}.""" - - text_document: "TextDocumentIdentifier" = attrs.field() - """The document to rename.""" - - position: "Position" = attrs.field() - """The position at which this request was sent.""" - - new_name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The new name of the symbol. If the given name is not valid the - request must return a {@link ResponseError} with an - appropriate message set.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class RenameOptions: - """Provider options for a {@link RenameRequest}.""" - - prepare_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Renames should be checked and tested before being executed. - - @since version 3.12.0""" - # Since: version 3.12.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class RenameRegistrationOptions: - """Registration options for a {@link RenameRequest}.""" - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - prepare_provider: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Renames should be checked and tested before being executed. - - @since version 3.12.0""" - # Since: version 3.12.0 - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class PrepareRenameParams: - text_document: "TextDocumentIdentifier" = attrs.field() - """The text document.""" - - position: "Position" = attrs.field() - """The position inside the text document.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class ExecuteCommandParams: - """The parameters of a {@link ExecuteCommandRequest}.""" - - command: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The identifier of the actual command handler.""" - - arguments: Optional[Sequence[LSPAny]] = attrs.field(default=None) - """Arguments that the command should be invoked with.""" - - work_done_token: Optional[ProgressToken] = attrs.field(default=None) - """An optional token that a server can use to report work done progress.""" - - -@attrs.define -class ExecuteCommandOptions: - """The server capabilities of a {@link ExecuteCommandRequest}.""" - - commands: Sequence[str] = attrs.field() - """The commands to be executed on the server""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class ExecuteCommandRegistrationOptions: - """Registration options for a {@link ExecuteCommandRequest}.""" - - commands: Sequence[str] = attrs.field() - """The commands to be executed on the server""" - - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - -@attrs.define -class ApplyWorkspaceEditParams: - """The parameters passed via an apply workspace edit request.""" - - edit: WorkspaceEdit = attrs.field() - """The edits to apply.""" - - label: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional label of the workspace edit. This label is - presented in the user interface for example on an undo - stack to undo the workspace edit.""" - - -@attrs.define -class ApplyWorkspaceEditResult: - """The result returned from the apply workspace edit request. - - @since 3.17 renamed from ApplyWorkspaceEditResponse""" - - # Since: 3.17 renamed from ApplyWorkspaceEditResponse - - applied: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """Indicates whether the edit was applied or not.""" - - failure_reason: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional textual description for why the edit was not applied. - This may be used by the server for diagnostic logging or to provide - a suitable error for a request that triggered the edit.""" - - failed_change: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """Depending on the client's failure handling strategy `failedChange` might - contain the index of the change that failed. This property is only available - if the client signals a `failureHandlingStrategy` in its client capabilities.""" - - -@attrs.define -class WorkDoneProgressBegin: - title: str = attrs.field(validator=attrs.validators.instance_of(str)) - """Mandatory title of the progress operation. Used to briefly inform about - the kind of operation being performed. - - Examples: "Indexing" or "Linking dependencies".""" - - kind: str = attrs.field(validator=attrs.validators.in_(["begin"]), default="begin") - - cancellable: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Controls if a cancel button should show to allow the user to cancel the - long running operation. Clients that don't support cancellation are allowed - to ignore the setting.""" - - message: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """Optional, more detailed associated progress message. Contains - complementary information to the `title`. - - Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". - If unset, the previous progress message (if any) is still valid.""" - - percentage: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """Optional progress percentage to display (value 100 is considered 100%). - If not provided infinite progress is assumed and clients are allowed - to ignore the `percentage` value in subsequent in report notifications. - - The value should be steadily rising. Clients are free to ignore values - that are not following this rule. The value range is [0, 100].""" - - -@attrs.define -class WorkDoneProgressReport: - kind: str = attrs.field( - validator=attrs.validators.in_(["report"]), default="report" - ) - - cancellable: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Controls enablement state of a cancel button. - - Clients that don't support cancellation or don't support controlling the button's - enablement state are allowed to ignore the property.""" - - message: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """Optional, more detailed associated progress message. Contains - complementary information to the `title`. - - Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". - If unset, the previous progress message (if any) is still valid.""" - - percentage: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """Optional progress percentage to display (value 100 is considered 100%). - If not provided infinite progress is assumed and clients are allowed - to ignore the `percentage` value in subsequent in report notifications. - - The value should be steadily rising. Clients are free to ignore values - that are not following this rule. The value range is [0, 100]""" - - -@attrs.define -class WorkDoneProgressEnd: - kind: str = attrs.field(validator=attrs.validators.in_(["end"]), default="end") - - message: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """Optional, a final message indicating to for example indicate the outcome - of the operation.""" - - -@attrs.define -class SetTraceParams: - value: TraceValues = attrs.field() - - -@attrs.define -class LogTraceParams: - message: str = attrs.field(validator=attrs.validators.instance_of(str)) - - verbose: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - - -@attrs.define -class CancelParams: - id: Union[int, str] = attrs.field() - """The request id to cancel.""" - - -@attrs.define -class ProgressParams: - token: ProgressToken = attrs.field() - """The progress token provided by the client or server.""" - - value: LSPAny = attrs.field() - """The progress data.""" - - -@attrs.define -class LocationLink: - """Represents the connection of two locations. Provides additional metadata over normal {@link Location locations}, - including an origin range.""" - - target_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The target resource identifier of this link.""" - - target_range: "Range" = attrs.field() - """The full target range of this link. If the target for example is a symbol then target range is the - range enclosing this symbol not including leading/trailing whitespace but everything else - like comments. This information is typically used to highlight the range in the editor.""" - - target_selection_range: "Range" = attrs.field() - """The range that should be selected and revealed when this link is being followed, e.g the name of a function. - Must be contained by the `targetRange`. See also `DocumentSymbol#range`""" - - origin_selection_range: Optional["Range"] = attrs.field(default=None) - """Span of the origin of this link. - - Used as the underlined span for mouse interaction. Defaults to the word range at - the definition position.""" - - -@attrs.define -class Range: - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. - For example: - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ```""" - - start: "Position" = attrs.field() - """The range's start position.""" - - end: "Position" = attrs.field() - """The range's end position.""" - - def __eq__(self, o: object) -> bool: - if not isinstance(o, Range): - return NotImplemented - return (self.start == o.start) and (self.end == o.end) - - def __repr__(self) -> str: - return f"{self.start!r}-{self.end!r}" - - -@attrs.define -class WorkspaceFoldersChangeEvent: - """The workspace folder change event.""" - - added: Sequence[WorkspaceFolder] = attrs.field() - """The array of added workspace folders""" - - removed: Sequence[WorkspaceFolder] = attrs.field() - """The array of the removed workspace folders""" - - -@attrs.define -class ConfigurationItem: - scope_uri: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The scope to get the configuration section for.""" - - section: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The configuration section asked for.""" - - -@attrs.define -class TextDocumentIdentifier: - """A literal to identify a text document in the client.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The text document's uri.""" - - -@attrs.define -class Color: - """Represents a color in RGBA space.""" - - red: float = attrs.field(validator=attrs.validators.instance_of(float)) - """The red component of this color in the range [0-1].""" - - green: float = attrs.field(validator=attrs.validators.instance_of(float)) - """The green component of this color in the range [0-1].""" - - blue: float = attrs.field(validator=attrs.validators.instance_of(float)) - """The blue component of this color in the range [0-1].""" - - alpha: float = attrs.field(validator=attrs.validators.instance_of(float)) - """The alpha component of this color in the range [0-1].""" - - -@attrs.define -@functools.total_ordering -class Position: - """Position in a text document expressed as zero-based line and character - offset. Prior to 3.17 the offsets were always based on a UTF-16 string - representation. So a string of the form `a𐐀b` the character offset of the - character `a` is 0, the character offset of `𐐀` is 1 and the character - offset of b is 3 since `𐐀` is represented using two code units in UTF-16. - Since 3.17 clients and servers can agree on a different string encoding - representation (e.g. UTF-8). The client announces it's supported encoding - via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities). - The value is an array of position encodings the client supports, with - decreasing preference (e.g. the encoding at index `0` is the most preferred - one). To stay backwards compatible the only mandatory encoding is UTF-16 - represented via the string `utf-16`. The server can pick one of the - encodings offered by the client and signals that encoding back to the - client via the initialize result's property - [`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value - `utf-16` is missing from the client's capability `general.positionEncodings` - servers can safely assume that the client supports UTF-16. If the server - omits the position encoding in its initialize result the encoding defaults - to the string value `utf-16`. Implementation considerations: since the - conversion from one encoding into another requires the content of the - file / line the conversion is best done where the file is read which is - usually on the server side. - - Positions are line end character agnostic. So you can not specify a position - that denotes `\r|\n` or `\n|` where `|` represents the character offset. - - @since 3.17.0 - support for negotiated position encoding.""" - - # Since: 3.17.0 - support for negotiated position encoding. - - line: int = attrs.field(validator=validators.uinteger_validator) - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. - If a line number is negative, it defaults to 0.""" - - character: int = attrs.field(validator=validators.uinteger_validator) - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length.""" - - def __eq__(self, o: object) -> bool: - if not isinstance(o, Position): - return NotImplemented - return (self.line, self.character) == (o.line, o.character) - - def __gt__(self, o: "Position") -> bool: - if not isinstance(o, Position): - return NotImplemented - return (self.line, self.character) > (o.line, o.character) - - def __repr__(self) -> str: - return f"{self.line}:{self.character}" - - -@attrs.define -class SemanticTokensEdit: - """@since 3.16.0""" - - # Since: 3.16.0 - - start: int = attrs.field(validator=validators.uinteger_validator) - """The start offset of the edit.""" - - delete_count: int = attrs.field(validator=validators.uinteger_validator) - """The count of elements to remove.""" - - data: Optional[Sequence[int]] = attrs.field(default=None) - """The elements to insert.""" - - -@attrs.define -class FileCreate: - """Represents information on a file/folder create. - - @since 3.16.0""" - - # Since: 3.16.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A file:// URI for the location of the file/folder being created.""" - - -@attrs.define -class TextDocumentEdit: - """Describes textual changes on a text document. A TextDocumentEdit describes all changes - on a document version Si and after they are applied move the document to version Si+1. - So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any - kind of ordering. However the edits must be non overlapping.""" - - text_document: "OptionalVersionedTextDocumentIdentifier" = attrs.field() - """The text document to change.""" - - edits: Sequence[Union[TextEdit, "AnnotatedTextEdit"]] = attrs.field() - """The edits to be applied. - - @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a - client capability.""" - # Since: 3.16.0 - support for AnnotatedTextEdit. This is guarded using aclient capability. - - -@attrs.define -class ResourceOperation: - """A generic resource operation.""" - - kind: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The resource operation kind.""" - - annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) - """An optional annotation identifier describing the operation. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class CreateFile: - """Create file operation.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The resource to create.""" - - kind: str = attrs.field( - validator=attrs.validators.in_(["create"]), default="create" - ) - """A create""" - - options: Optional["CreateFileOptions"] = attrs.field(default=None) - """Additional options""" - - annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) - """An optional annotation identifier describing the operation. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class RenameFile: - """Rename file operation""" - - old_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The old (existing) location.""" - - new_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The new location.""" - - kind: str = attrs.field( - validator=attrs.validators.in_(["rename"]), default="rename" - ) - """A rename""" - - options: Optional["RenameFileOptions"] = attrs.field(default=None) - """Rename options.""" - - annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) - """An optional annotation identifier describing the operation. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class DeleteFile: - """Delete file operation""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The file to delete.""" - - kind: str = attrs.field( - validator=attrs.validators.in_(["delete"]), default="delete" - ) - """A delete""" - - options: Optional["DeleteFileOptions"] = attrs.field(default=None) - """Delete options.""" - - annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) - """An optional annotation identifier describing the operation. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class ChangeAnnotation: - """Additional information that describes document changes. - - @since 3.16.0""" - - # Since: 3.16.0 - - label: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A human-readable string describing the actual change. The string - is rendered prominent in the user interface.""" - - needs_confirmation: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """A flag which indicates that user confirmation is needed - before applying the change.""" - - description: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A human-readable string which is rendered less prominent in - the user interface.""" - - -@attrs.define -class FileOperationFilter: - """A filter to describe in which file operation requests or notifications - the server is interested in receiving. - - @since 3.16.0""" - - # Since: 3.16.0 - - pattern: "FileOperationPattern" = attrs.field() - """The actual file operation pattern.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri scheme like `file` or `untitled`.""" - - -@attrs.define -class FileRename: - """Represents information on a file/folder rename. - - @since 3.16.0""" - - # Since: 3.16.0 - - old_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A file:// URI for the original location of the file/folder being renamed.""" - - new_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A file:// URI for the new location of the file/folder being renamed.""" - - -@attrs.define -class FileDelete: - """Represents information on a file/folder delete. - - @since 3.16.0""" - - # Since: 3.16.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A file:// URI for the location of the file/folder being deleted.""" - - -@attrs.define -class InlineValueContext: - """@since 3.17.0""" - - # Since: 3.17.0 - - frame_id: int = attrs.field(validator=validators.integer_validator) - """The stack frame (as a DAP Id) where the execution has stopped.""" - - stopped_location: Range = attrs.field() - """The document range where execution has stopped. - Typically the end position of the range denotes the line where the inline values are shown.""" - - -@attrs.define -class InlineValueText: - """Provide inline value as text. - - @since 3.17.0""" - - # Since: 3.17.0 - - range: Range = attrs.field() - """The document range for which the inline value applies.""" - - text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The text of the inline value.""" - - -@attrs.define -class InlineValueVariableLookup: - """Provide inline value through a variable lookup. - If only a range is specified, the variable name will be extracted from the underlying document. - An optional variable name can be used to override the extracted name. - - @since 3.17.0""" - - # Since: 3.17.0 - - range: Range = attrs.field() - """The document range for which the inline value applies. - The range is used to extract the variable name from the underlying document.""" - - case_sensitive_lookup: bool = attrs.field( - validator=attrs.validators.instance_of(bool) - ) - """How to perform the lookup.""" - - variable_name: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """If specified the name of the variable to look up.""" - - -@attrs.define -class InlineValueEvaluatableExpression: - """Provide an inline value through an expression evaluation. - If only a range is specified, the expression will be extracted from the underlying document. - An optional expression can be used to override the extracted expression. - - @since 3.17.0""" - - # Since: 3.17.0 - - range: Range = attrs.field() - """The document range for which the inline value applies. - The range is used to extract the evaluatable expression from the underlying document.""" - - expression: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """If specified the expression overrides the extracted expression.""" - - -@attrs.define -class InlayHintLabelPart: - """An inlay hint label part allows for interactive and composite labels - of inlay hints. - - @since 3.17.0""" - - # Since: 3.17.0 - - value: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The value of this label part.""" - - tooltip: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) - """The tooltip text when you hover over this label part. Depending on - the client capability `inlayHint.resolveSupport` clients might resolve - this property late using the resolve request.""" - - location: Optional[Location] = attrs.field(default=None) - """An optional source code location that represents this - label part. - - The editor will use this location for the hover and for code navigation - features: This part will become a clickable link that resolves to the - definition of the symbol at the given location (not necessarily the - location itself), it shows the hover that shows at the given location, - and it shows a context menu with further code navigation commands. - - Depending on the client capability `inlayHint.resolveSupport` clients - might resolve this property late using the resolve request.""" - - command: Optional[Command] = attrs.field(default=None) - """An optional command for this label part. - - Depending on the client capability `inlayHint.resolveSupport` clients - might resolve this property late using the resolve request.""" - - -@attrs.define -class MarkupContent: - """A `MarkupContent` literal represents a string value which content is interpreted base on its - kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds. - - If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues. - See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting - - Here is an example how such a string can be constructed using JavaScript / TypeScript: - ```ts - let markdown: MarkdownContent = { - kind: MarkupKind.Markdown, - value: [ - '# Header', - 'Some text', - '```typescript', - 'someCode();', - '```' - ].join('\n') - }; - ``` - - *Please Note* that clients might sanitize the return markdown. A client could decide to - remove HTML from the markdown to avoid script execution.""" - - kind: MarkupKind = attrs.field() - """The type of the Markup""" - - value: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The content itself""" - - -@attrs.define -class FullDocumentDiagnosticReport: - """A diagnostic report with a full set of problems. - - @since 3.17.0""" - - # Since: 3.17.0 - - items: Sequence["Diagnostic"] = attrs.field() - """The actual items.""" - - kind: str = attrs.field(validator=attrs.validators.in_(["full"]), default="full") - """A full document diagnostic report.""" - - result_id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional result id. If provided it will - be sent on the next diagnostic request for the - same document.""" - - -@attrs.define -class RelatedFullDocumentDiagnosticReport: - """A full diagnostic report with a set of related documents. - - @since 3.17.0""" - - # Since: 3.17.0 - - items: Sequence["Diagnostic"] = attrs.field() - """The actual items.""" - - related_documents: Optional[ - Dict[ - str, - Union[FullDocumentDiagnosticReport, "UnchangedDocumentDiagnosticReport"], - ] - ] = attrs.field(default=None) - """Diagnostics of related documents. This information is useful - in programming languages where code in a file A can generate - diagnostics in a file B which A depends on. An example of - such a language is C/C++ where marco definitions in a file - a.cpp and result in errors in a header file b.hpp. - - @since 3.17.0""" - # Since: 3.17.0 - - kind: str = attrs.field(validator=attrs.validators.in_(["full"]), default="full") - """A full document diagnostic report.""" - - result_id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional result id. If provided it will - be sent on the next diagnostic request for the - same document.""" - - -@attrs.define -class UnchangedDocumentDiagnosticReport: - """A diagnostic report indicating that the last returned - report is still accurate. - - @since 3.17.0""" - - # Since: 3.17.0 - - result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A result id which will be sent on the next - diagnostic request for the same document.""" - - kind: str = attrs.field( - validator=attrs.validators.in_(["unchanged"]), default="unchanged" - ) - """A document diagnostic report indicating - no changes to the last result. A server can - only return `unchanged` if result ids are - provided.""" - - -@attrs.define -class RelatedUnchangedDocumentDiagnosticReport: - """An unchanged diagnostic report with a set of related documents. - - @since 3.17.0""" - - # Since: 3.17.0 - - result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A result id which will be sent on the next - diagnostic request for the same document.""" - - related_documents: Optional[ - Dict[ - str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport] - ] - ] = attrs.field(default=None) - """Diagnostics of related documents. This information is useful - in programming languages where code in a file A can generate - diagnostics in a file B which A depends on. An example of - such a language is C/C++ where marco definitions in a file - a.cpp and result in errors in a header file b.hpp. - - @since 3.17.0""" - # Since: 3.17.0 - - kind: str = attrs.field( - validator=attrs.validators.in_(["unchanged"]), default="unchanged" - ) - """A document diagnostic report indicating - no changes to the last result. A server can - only return `unchanged` if result ids are - provided.""" - - -@attrs.define -class PreviousResultId: - """A previous result id in a workspace pull request. - - @since 3.17.0""" - - # Since: 3.17.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The URI for which the client knowns a - result id.""" - - value: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The value of the previous result id.""" - - -@attrs.define -class NotebookDocument: - """A notebook document. - - @since 3.17.0""" - - # Since: 3.17.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The notebook document's uri.""" - - notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The type of the notebook.""" - - version: int = attrs.field(validator=validators.integer_validator) - """The version number of this document (it will increase after each - change, including undo/redo).""" - - cells: Sequence["NotebookCell"] = attrs.field() - """The cells of a notebook.""" - - metadata: Optional[LSPObject] = attrs.field(default=None) - """Additional metadata stored with the notebook - document. - - Note: should always be an object literal (e.g. LSPObject)""" - - -@attrs.define -class TextDocumentItem: - """An item to transfer a text document from the client to the - server.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The text document's uri.""" - - language_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The text document's language identifier.""" - - version: int = attrs.field(validator=validators.integer_validator) - """The version number of this document (it will increase after each - change, including undo/redo).""" - - text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The content of the opened text document.""" - - -@attrs.define -class VersionedNotebookDocumentIdentifier: - """A versioned notebook document identifier. - - @since 3.17.0""" - - # Since: 3.17.0 - - version: int = attrs.field(validator=validators.integer_validator) - """The version number of this notebook document.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The notebook document's uri.""" - - -@attrs.define -<<<<<<< HEAD -class NotebookDocumentChangeEventCellsTypeStructureType: - array: "NotebookCellArrayChange" = attrs.field() - """The change to the cell array.""" - - did_open: Optional[Sequence[TextDocumentItem]] = attrs.field(default=None) - """Additional opened cell text documents.""" - - did_close: Optional[Sequence[TextDocumentIdentifier]] = attrs.field(default=None) - """Additional closed cell text documents.""" - - -@attrs.define -class NotebookDocumentChangeEventCellsTypeTextContentType: - document: "VersionedTextDocumentIdentifier" = attrs.field() - - changes: Sequence[TextDocumentContentChangeEvent] = attrs.field() - - -@attrs.define -class NotebookDocumentChangeEventCellsType: - structure: Optional[ - "NotebookDocumentChangeEventCellsTypeStructureType" - ] = attrs.field(default=None) - """Changes to the cell structure to add or - remove cells.""" - - data: Optional[Sequence["NotebookCell"]] = attrs.field(default=None) - """Changes to notebook cells properties like its - kind, execution summary or metadata.""" - - text_content: Optional[ - Sequence["NotebookDocumentChangeEventCellsTypeTextContentType"] - ] = attrs.field(default=None) - """Changes to the text content of notebook cells.""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class NotebookDocumentChangeEvent: - """A change event for a notebook document. - - @since 3.17.0""" - - # Since: 3.17.0 - - metadata: Optional[LSPObject] = attrs.field(default=None) - """The changed meta data if any. - - Note: should always be an object literal (e.g. LSPObject)""" - - cells: Optional["NotebookDocumentCellChanges"] = attrs.field(default=None) - """Changes to cells""" - - -@attrs.define -class NotebookDocumentIdentifier: - """A literal to identify a notebook document in the client. - - @since 3.17.0""" - - # Since: 3.17.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The notebook document's uri.""" - - -@attrs.define -class InlineCompletionContext: - """Provides information about the context in which an inline completion was requested. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - trigger_kind: InlineCompletionTriggerKind = attrs.field() - """Describes how the inline completion was triggered.""" - - selected_completion_info: Optional["SelectedCompletionInfo"] = attrs.field( - default=None - ) - """Provides information about the currently selected item in the autocomplete widget if it is visible.""" - - -@attrs.define -class StringValue: - """A string value used as a snippet is a template which allows to insert text - and to control the editor cursor when insertion happens. - - A snippet can define tab stops and placeholders with `$1`, `$2` - and `${3:foo}`. `$0` defines the final tab stop, it defaults to - the end of the snippet. Variables are defined with `$name` and - `${name:default value}`. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The snippet string.""" - - kind: str = attrs.field( - validator=attrs.validators.in_(["snippet"]), default="snippet" - ) - """The kind of string value.""" - - -@attrs.define -class Registration: - """General parameters to register for a notification or to register a provider.""" - - id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The id used to register the request. The id can be used to deregister - the request again.""" - - method: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The method / capability to register for.""" - - register_options: Optional[LSPAny] = attrs.field(default=None) - """Options necessary for the registration.""" - - -@attrs.define -class Unregistration: - """General parameters to unregister a request or notification.""" - - id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The id used to unregister the request or notification. Usually an id - provided during the register request.""" - - method: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The method to unregister for.""" - - -@attrs.define -class ServerCapabilities: - """Defines the capabilities provided by a language - server.""" - - position_encoding: Optional[Union[PositionEncodingKind, str]] = attrs.field( - default=None - ) - """The position encoding the server picked from the encodings offered - by the client via the client capability `general.positionEncodings`. - - If the client didn't provide any position encodings the only valid - value that a server can return is 'utf-16'. - - If omitted it defaults to 'utf-16'. - - @since 3.17.0""" - # Since: 3.17.0 - - text_document_sync: Optional[ - Union["TextDocumentSyncOptions", TextDocumentSyncKind] - ] = attrs.field(default=None) - """Defines how text documents are synced. Is either a detailed structure - defining each notification or for backwards compatibility the - TextDocumentSyncKind number.""" - - notebook_document_sync: Optional[ - Union["NotebookDocumentSyncOptions", "NotebookDocumentSyncRegistrationOptions"] - ] = attrs.field(default=None) - """Defines how notebook documents are synced. - - @since 3.17.0""" - # Since: 3.17.0 - - completion_provider: Optional[CompletionOptions] = attrs.field(default=None) - """The server provides completion support.""" - - hover_provider: Optional[Union[bool, HoverOptions]] = attrs.field(default=None) - """The server provides hover support.""" - - signature_help_provider: Optional[SignatureHelpOptions] = attrs.field(default=None) - """The server provides signature help support.""" - - declaration_provider: Optional[ - Union[bool, DeclarationOptions, DeclarationRegistrationOptions] - ] = attrs.field(default=None) - """The server provides Goto Declaration support.""" - - definition_provider: Optional[Union[bool, DefinitionOptions]] = attrs.field( - default=None - ) - """The server provides goto definition support.""" - - type_definition_provider: Optional[ - Union[bool, TypeDefinitionOptions, TypeDefinitionRegistrationOptions] - ] = attrs.field(default=None) - """The server provides Goto Type Definition support.""" - - implementation_provider: Optional[ - Union[bool, ImplementationOptions, ImplementationRegistrationOptions] - ] = attrs.field(default=None) - """The server provides Goto Implementation support.""" - - references_provider: Optional[Union[bool, ReferenceOptions]] = attrs.field( - default=None - ) - """The server provides find references support.""" - - document_highlight_provider: Optional[ - Union[bool, DocumentHighlightOptions] - ] = attrs.field(default=None) - """The server provides document highlight support.""" - - document_symbol_provider: Optional[ - Union[bool, DocumentSymbolOptions] - ] = attrs.field(default=None) - """The server provides document symbol support.""" - - code_action_provider: Optional[Union[bool, CodeActionOptions]] = attrs.field( - default=None - ) - """The server provides code actions. CodeActionOptions may only be - specified if the client states that it supports - `codeActionLiteralSupport` in its initial `initialize` request.""" - - code_lens_provider: Optional[CodeLensOptions] = attrs.field(default=None) - """The server provides code lens.""" - - document_link_provider: Optional[DocumentLinkOptions] = attrs.field(default=None) - """The server provides document link support.""" - - color_provider: Optional[ - Union[bool, DocumentColorOptions, DocumentColorRegistrationOptions] - ] = attrs.field(default=None) - """The server provides color provider support.""" - - workspace_symbol_provider: Optional[ - Union[bool, WorkspaceSymbolOptions] - ] = attrs.field(default=None) - """The server provides workspace symbol support.""" - - document_formatting_provider: Optional[ - Union[bool, DocumentFormattingOptions] - ] = attrs.field(default=None) - """The server provides document formatting.""" - - document_range_formatting_provider: Optional[ - Union[bool, DocumentRangeFormattingOptions] - ] = attrs.field(default=None) - """The server provides document range formatting.""" - - document_on_type_formatting_provider: Optional[ - DocumentOnTypeFormattingOptions - ] = attrs.field(default=None) - """The server provides document formatting on typing.""" - - rename_provider: Optional[Union[bool, RenameOptions]] = attrs.field(default=None) - """The server provides rename support. RenameOptions may only be - specified if the client states that it supports - `prepareSupport` in its initial `initialize` request.""" - - folding_range_provider: Optional[ - Union[bool, FoldingRangeOptions, FoldingRangeRegistrationOptions] - ] = attrs.field(default=None) - """The server provides folding provider support.""" - - selection_range_provider: Optional[ - Union[bool, SelectionRangeOptions, SelectionRangeRegistrationOptions] - ] = attrs.field(default=None) - """The server provides selection range support.""" - - execute_command_provider: Optional[ExecuteCommandOptions] = attrs.field( - default=None - ) - """The server provides execute command support.""" - - call_hierarchy_provider: Optional[ - Union[bool, CallHierarchyOptions, CallHierarchyRegistrationOptions] - ] = attrs.field(default=None) - """The server provides call hierarchy support. - - @since 3.16.0""" - # Since: 3.16.0 - - linked_editing_range_provider: Optional[ - Union[bool, LinkedEditingRangeOptions, LinkedEditingRangeRegistrationOptions] - ] = attrs.field(default=None) - """The server provides linked editing range support. - - @since 3.16.0""" - # Since: 3.16.0 - - semantic_tokens_provider: Optional[ - Union[SemanticTokensOptions, SemanticTokensRegistrationOptions] - ] = attrs.field(default=None) - """The server provides semantic tokens support. - - @since 3.16.0""" - # Since: 3.16.0 - - moniker_provider: Optional[ - Union[bool, MonikerOptions, MonikerRegistrationOptions] - ] = attrs.field(default=None) - """The server provides moniker support. - - @since 3.16.0""" - # Since: 3.16.0 - - type_hierarchy_provider: Optional[ - Union[bool, TypeHierarchyOptions, TypeHierarchyRegistrationOptions] - ] = attrs.field(default=None) - """The server provides type hierarchy support. - - @since 3.17.0""" - # Since: 3.17.0 - - inline_value_provider: Optional[ - Union[bool, InlineValueOptions, InlineValueRegistrationOptions] - ] = attrs.field(default=None) - """The server provides inline values. - - @since 3.17.0""" - # Since: 3.17.0 - - inlay_hint_provider: Optional[ - Union[bool, InlayHintOptions, InlayHintRegistrationOptions] - ] = attrs.field(default=None) - """The server provides inlay hints. - - @since 3.17.0""" - # Since: 3.17.0 - - diagnostic_provider: Optional[ - Union[DiagnosticOptions, DiagnosticRegistrationOptions] - ] = attrs.field(default=None) - """The server has support for pull model diagnostics. - - @since 3.17.0""" - # Since: 3.17.0 - - inline_completion_provider: Optional[ - Union[bool, InlineCompletionOptions] - ] = attrs.field(default=None) - """Inline completion options used during static registration. - - @since 3.18.0 - @proposed""" - # Since: 3.18.0 - # Proposed - - workspace: Optional["WorkspaceOptions"] = attrs.field(default=None) - """Workspace specific server capabilities.""" - - experimental: Optional[LSPAny] = attrs.field(default=None) - """Experimental server capabilities.""" - - -@attrs.define -class ServerInfo: - """Information about the server - - @since 3.15.0 - @since 3.18.0 ServerInfo type name added. - @proposed""" - - # Since: 3.18.0 ServerInfo type name added. - # Proposed - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of the server as defined by the server.""" - - version: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The server's version as defined by the server.""" - - -@attrs.define -class VersionedTextDocumentIdentifier: - """A text document identifier to denote a specific version of a text document.""" - - version: int = attrs.field(validator=validators.integer_validator) - """The version number of this document.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The text document's uri.""" - - -@attrs.define -class FileEvent: - """An event describing a file change.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The file's uri.""" - - type: FileChangeType = attrs.field() - """The change type.""" - - -@attrs.define -class FileSystemWatcher: - glob_pattern: GlobPattern = attrs.field() - """The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail. - - @since 3.17.0 support for relative patterns.""" - # Since: 3.17.0 support for relative patterns. - - kind: Optional[Union[WatchKind, int]] = attrs.field(default=None) - """The kind of events of interest. If omitted it defaults - to WatchKind.Create | WatchKind.Change | WatchKind.Delete - which is 7.""" - - -@attrs.define -class Diagnostic: - """Represents a diagnostic, such as a compiler error or warning. Diagnostic objects - are only valid in the scope of a resource.""" - - range: Range = attrs.field() - """The range at which the message applies""" - - message: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The diagnostic's message. It usually appears in the user interface""" - - severity: Optional[DiagnosticSeverity] = attrs.field(default=None) - """The diagnostic's severity. Can be omitted. If omitted it is up to the - client to interpret diagnostics as error, warning, info or hint.""" - - code: Optional[Union[int, str]] = attrs.field(default=None) - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Optional["CodeDescription"] = attrs.field(default=None) - """An optional property to describe the error code. - Requires the code field (above) to be present/not null. - - @since 3.16.0""" - # Since: 3.16.0 - - source: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A human-readable string describing the source of this - diagnostic, e.g. 'typescript' or 'super lint'. It usually - appears in the user interface.""" - - tags: Optional[Sequence[DiagnosticTag]] = attrs.field(default=None) - """Additional metadata about the diagnostic. - - @since 3.15.0""" - # Since: 3.15.0 - - related_information: Optional[ - Sequence["DiagnosticRelatedInformation"] - ] = attrs.field(default=None) - """An array of related diagnostic information, e.g. when symbol-names within - a scope collide all definitions can be marked via this property.""" - - data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class CompletionContext: - """Contains additional information about the context in which a completion request is triggered.""" - - trigger_kind: CompletionTriggerKind = attrs.field() - """How the completion was triggered.""" - - trigger_character: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The trigger character (a single character) that has trigger code complete. - Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`""" - - -@attrs.define -class CompletionItemLabelDetails: - """Additional details for a completion item label. - - @since 3.17.0""" - - # Since: 3.17.0 - - detail: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional string which is rendered less prominently directly after {@link CompletionItem.label label}, - without any spacing. Should be used for function signatures and type annotations.""" - - description: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used - for fully qualified names and file paths.""" - - -@attrs.define -class InsertReplaceEdit: - """A special text edit to provide an insert and a replace operation. - - @since 3.16.0""" - - # Since: 3.16.0 - - new_text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The string to be inserted.""" - - insert: Range = attrs.field() - """The range if the insert is requested""" - - replace: Range = attrs.field() - """The range if the replace is requested.""" - - -@attrs.define -class CompletionItemDefaults: - """In many cases the items of an actual completion result share the same - value for properties like `commitCharacters` or the range of a text - edit. A completion list can therefore define item defaults which will - be used if a completion item itself doesn't specify the value. - - If a completion list specifies a default value and a completion item - also specifies a corresponding value the one from the item is used. - - Servers are only allowed to return default values if the client - signals support for this via the `completionList.itemDefaults` - capability. - - @since 3.17.0""" - - # Since: 3.17.0 - - commit_characters: Optional[List[str]] = attrs.field(default=None) - """A default commit character set. - - @since 3.17.0""" - # Since: 3.17.0 - - edit_range: Optional[Union[Range, "EditRangeWithInsertReplace"]] = attrs.field( - default=None - ) - """A default edit range. - - @since 3.17.0""" - # Since: 3.17.0 - - insert_text_format: Optional[InsertTextFormat] = attrs.field(default=None) - """A default insert text format. - - @since 3.17.0""" - # Since: 3.17.0 - - insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) - """A default insert text mode. - - @since 3.17.0""" - # Since: 3.17.0 - - data: Optional[LSPAny] = attrs.field(default=None) - """A default data value. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class SignatureHelpContext: - """Additional information about the context in which a signature help request was triggered. - - @since 3.15.0""" - - # Since: 3.15.0 - - trigger_kind: SignatureHelpTriggerKind = attrs.field() - """Action that caused signature help to be triggered.""" - - is_retrigger: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """`true` if signature help was already showing when it was triggered. - - Retriggers occurs when the signature help is already active and can be caused by actions such as - typing a trigger character, a cursor move, or document content changes.""" - - trigger_character: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """Character that caused signature help to be triggered. - - This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`""" - - active_signature_help: Optional[SignatureHelp] = attrs.field(default=None) - """The currently active `SignatureHelp`. - - The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on - the user navigating through available signatures.""" - - -@attrs.define -class SignatureInformation: - """Represents the signature of something callable. A signature - can have a label, like a function-name, a doc-comment, and - a set of parameters.""" - - label: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The label of this signature. Will be shown in - the UI.""" - - documentation: Optional[Union[str, MarkupContent]] = attrs.field(default=None) - """The human-readable doc-comment of this signature. Will be shown - in the UI but can be omitted.""" - - parameters: Optional[Sequence["ParameterInformation"]] = attrs.field(default=None) - """The parameters of this signature.""" - - active_parameter: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The index of the active parameter. - - If provided, this is used in place of `SignatureHelp.activeParameter`. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class ReferenceContext: - """Value-object that contains additional information when - requesting references.""" - - include_declaration: bool = attrs.field( - validator=attrs.validators.instance_of(bool) - ) - """Include the declaration of the current symbol.""" - - -@attrs.define -class CodeActionContext: - """Contains additional diagnostic information about the context in which - a {@link CodeActionProvider.provideCodeActions code action} is run.""" - - diagnostics: Sequence[Diagnostic] = attrs.field() - """An array of diagnostics known on the client side overlapping the range provided to the - `textDocument/codeAction` request. They are provided so that the server knows which - errors are currently presented to the user for the given range. There is no guarantee - that these accurately reflect the error state of the resource. The primary parameter - to compute code actions is the provided range.""" - - only: Optional[Sequence[Union[CodeActionKind, str]]] = attrs.field(default=None) - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So servers - can omit computing them.""" - - trigger_kind: Optional[CodeActionTriggerKind] = attrs.field(default=None) - """The reason why code actions were requested. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class CodeActionDisabled: - """Captures why the code action is currently disabled. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - reason: str = attrs.field(validator=attrs.validators.instance_of(str)) - """Human readable description of why the code action is currently disabled. - - This is displayed in the code actions UI.""" - - -@attrs.define -class LocationUriOnly: - """Location with only uri and does not include range. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class FormattingOptions: - """Value-object describing what options formatting should use.""" - - tab_size: int = attrs.field(validator=validators.uinteger_validator) - """Size of a tab in spaces.""" - - insert_spaces: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """Prefer spaces over tabs.""" - - trim_trailing_whitespace: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Trim trailing whitespace on a line. - - @since 3.15.0""" - # Since: 3.15.0 - - insert_final_newline: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Insert a newline character at the end of the file if one does not exist. - - @since 3.15.0""" - # Since: 3.15.0 - - trim_final_newlines: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Trim all newlines after the final newline at the end of the file. - - @since 3.15.0""" - # Since: 3.15.0 - - -@attrs.define -class PrepareRenamePlaceholder: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - range: Range = attrs.field() - - placeholder: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class PrepareRenameDefaultBehavior: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - default_behavior: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - - -@attrs.define -class SemanticTokensLegend: - """@since 3.16.0""" - - # Since: 3.16.0 - - token_types: Sequence[str] = attrs.field() - """The token types a server uses.""" - - token_modifiers: Sequence[str] = attrs.field() - """The token modifiers a server uses.""" - - -@attrs.define -class SemanticTokensFullDelta: - """Semantic tokens options to support deltas for full documents - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - delta: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server supports deltas for full documents.""" - - -@attrs.define -class OptionalVersionedTextDocumentIdentifier: - """A text document identifier to optionally denote a specific version of a text document.""" - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The text document's uri.""" - - version: Optional[Union[int, None]] = attrs.field(default=None) - """The version number of this document. If a versioned text document identifier - is sent from the server to the client and the file is not open in the editor - (the server has not received an open notification before) the server can send - `null` to indicate that the version is unknown and the content on disk is the - truth (as specified with document content ownership).""" - - -@attrs.define -class AnnotatedTextEdit: - """A special text edit with an additional change annotation. - - @since 3.16.0.""" - - # Since: 3.16.0. - - annotation_id: ChangeAnnotationIdentifier = attrs.field() - """The actual identifier of the change annotation""" - - range: Range = attrs.field() - """The range of the text document to be manipulated. To insert - text into a document create a range where start === end.""" - - new_text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The string to be inserted. For delete operations use an - empty string.""" - - -@attrs.define -class CreateFileOptions: - """Options to create a file.""" - - overwrite: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Overwrite existing file. Overwrite wins over `ignoreIfExists`""" - - ignore_if_exists: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Ignore if exists.""" - - -@attrs.define -class RenameFileOptions: - """Rename file options""" - - overwrite: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Overwrite target if existing. Overwrite wins over `ignoreIfExists`""" - - ignore_if_exists: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Ignores if target exists.""" - - -@attrs.define -class DeleteFileOptions: - """Delete file options""" - - recursive: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Delete the content recursively if a folder is denoted.""" - - ignore_if_not_exists: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Ignore the operation if the file doesn't exist.""" - - -@attrs.define -class FileOperationPattern: - """A pattern to describe in which file operation requests or notifications - the server is interested in receiving. - - @since 3.16.0""" - - # Since: 3.16.0 - - glob: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The glob pattern to match. Glob patterns can have the following syntax: - - `*` to match one or more characters in a path segment - - `?` to match on one character in a path segment - - `**` to match any number of path segments, including none - - `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files) - - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) - - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)""" - - matches: Optional[FileOperationPatternKind] = attrs.field(default=None) - """Whether to match files or folders with this pattern. - - Matches both if undefined.""" - - options: Optional["FileOperationPatternOptions"] = attrs.field(default=None) - """Additional options used during matching.""" - - -@attrs.define -class WorkspaceFullDocumentDiagnosticReport: - """A full document diagnostic report for a workspace diagnostic result. - - @since 3.17.0""" - - # Since: 3.17.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The URI for which diagnostic information is reported.""" - - items: Sequence[Diagnostic] = attrs.field() - """The actual items.""" - - version: Optional[Union[int, None]] = attrs.field(default=None) - """The version number for which the diagnostics are reported. - If the document is not marked as open `null` can be provided.""" - - kind: str = attrs.field(validator=attrs.validators.in_(["full"]), default="full") - """A full document diagnostic report.""" - - result_id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """An optional result id. If provided it will - be sent on the next diagnostic request for the - same document.""" - - -@attrs.define -class WorkspaceUnchangedDocumentDiagnosticReport: - """An unchanged document diagnostic report for a workspace diagnostic result. - - @since 3.17.0""" - - # Since: 3.17.0 - - uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The URI for which diagnostic information is reported.""" - - result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A result id which will be sent on the next - diagnostic request for the same document.""" - - version: Optional[Union[int, None]] = attrs.field(default=None) - """The version number for which the diagnostics are reported. - If the document is not marked as open `null` can be provided.""" - - kind: str = attrs.field( - validator=attrs.validators.in_(["unchanged"]), default="unchanged" - ) - """A document diagnostic report indicating - no changes to the last result. A server can - only return `unchanged` if result ids are - provided.""" - - -@attrs.define -class NotebookCell: - """A notebook cell. - - A cell's document URI must be unique across ALL notebook - cells and can therefore be used to uniquely identify a - notebook cell or the cell's text document. - - @since 3.17.0""" - - # Since: 3.17.0 - - kind: NotebookCellKind = attrs.field() - """The cell's kind""" - - document: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The URI of the cell's text document - content.""" - - metadata: Optional[LSPObject] = attrs.field(default=None) - """Additional metadata stored with the cell. - - Note: should always be an object literal (e.g. LSPObject)""" - - execution_summary: Optional["ExecutionSummary"] = attrs.field(default=None) - """Additional execution summary information - if supported by the client.""" - - -@attrs.define -class NotebookDocumentCellChanges: - """Cell changes to a notebook document. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - structure: Optional["NotebookDocumentCellChangeStructure"] = attrs.field( - default=None - ) - """Changes to the cell structure to add or - remove cells.""" - - data: Optional[List[NotebookCell]] = attrs.field(default=None) - """Changes to notebook cells properties like its - kind, execution summary or metadata.""" - -<<<<<<< HEAD - cells: Optional[Sequence[NotebookCell]] = attrs.field(default=None) - """The new cells, if any""" -======= - text_content: Optional[List["NotebookDocumentCellContentChanges"]] = attrs.field( - default=None - ) - """Changes to the text content of notebook cells.""" ->>>>>>> 1a6f18e (vNext LSP) - - -@attrs.define -class SelectedCompletionInfo: - """Describes the currently selected completion item. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - range: Range = attrs.field() - """The range that will be replaced if this completion item is accepted.""" - - text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The text the range will be replaced with if this completion is accepted.""" - - -@attrs.define -class ClientInfo: - """Information about the client - - @since 3.15.0 - @since 3.18.0 ClientInfo type name added. - @proposed""" - - # Since: 3.18.0 ClientInfo type name added. - # Proposed - - name: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of the client as defined by the client.""" - - version: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The client's version as defined by the client.""" - - -@attrs.define -class ClientCapabilities: - """Defines the capabilities provided by the client.""" - - workspace: Optional["WorkspaceClientCapabilities"] = attrs.field(default=None) - """Workspace specific client capabilities.""" - - text_document: Optional["TextDocumentClientCapabilities"] = attrs.field( - default=None - ) - """Text document specific client capabilities.""" - - notebook_document: Optional["NotebookDocumentClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the notebook document support. - - @since 3.17.0""" - # Since: 3.17.0 - - window: Optional["WindowClientCapabilities"] = attrs.field(default=None) - """Window specific client capabilities.""" - - general: Optional["GeneralClientCapabilities"] = attrs.field(default=None) - """General client capabilities. - - @since 3.16.0""" - # Since: 3.16.0 - - experimental: Optional[LSPAny] = attrs.field(default=None) - """Experimental client capabilities.""" - - -@attrs.define -class TextDocumentSyncOptions: - open_close: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Open and close notifications are sent to the server. If omitted open close notification should not - be sent.""" - - change: Optional[TextDocumentSyncKind] = attrs.field(default=None) - """Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full - and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.""" - - will_save: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """If present will save notifications are sent to the server. If omitted the notification should not be - sent.""" - - will_save_wait_until: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """If present will save wait until requests are sent to the server. If omitted the request should not be - sent.""" - - save: Optional[Union[bool, SaveOptions]] = attrs.field(default=None) - """If present save notifications are sent to the server. If omitted the notification should not be - sent.""" - - -@attrs.define -<<<<<<< HEAD -class NotebookDocumentSyncOptionsNotebookSelectorType1CellsType: - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class NotebookDocumentSyncOptionsNotebookSelectorType1: - notebook: Union[str, NotebookDocumentFilter] = attrs.field() - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - cells: Optional[ - Sequence["NotebookDocumentSyncOptionsNotebookSelectorType1CellsType"] - ] = attrs.field(default=None) - """The cells of the matching notebook to be synced.""" - - -@attrs.define -class NotebookDocumentSyncOptionsNotebookSelectorType2CellsType: - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class NotebookDocumentSyncOptionsNotebookSelectorType2: - cells: Sequence[ - "NotebookDocumentSyncOptionsNotebookSelectorType2CellsType" - ] = attrs.field() - """The cells of the matching notebook to be synced.""" - - notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class NotebookDocumentSyncOptions: - """Options specific to a notebook plus its cells - to be synced to the server. - - If a selector provides a notebook document - filter but no cell selector all cells of a - matching notebook document will be synced. - - If a selector provides no notebook document - filter but only a cell selector all notebook - document that contain at least one matching - cell will be synced. - - @since 3.17.0""" - - # Since: 3.17.0 - -<<<<<<< HEAD - notebook_selector: Sequence[ - Union[ - "NotebookDocumentSyncOptionsNotebookSelectorType1", - "NotebookDocumentSyncOptionsNotebookSelectorType2", - ] -======= - notebook_selector: List[ - Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] ->>>>>>> 1a6f18e (vNext LSP) - ] = attrs.field() - """The notebooks to be synced""" - - save: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether save notification should be forwarded to - the server. Will only be honored if mode === `notebook`.""" - - -@attrs.define -<<<<<<< HEAD -class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType: - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1: - notebook: Union[str, NotebookDocumentFilter] = attrs.field() - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - cells: Optional[ - Sequence[ - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType" - ] - ] = attrs.field(default=None) - """The cells of the matching notebook to be synced.""" - - -@attrs.define -class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType: - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2: - cells: Sequence[ - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType" - ] = attrs.field() - """The cells of the matching notebook to be synced.""" - - notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class NotebookDocumentSyncRegistrationOptions: - """Registration options specific to a notebook. - - @since 3.17.0""" - - # Since: 3.17.0 - -<<<<<<< HEAD - notebook_selector: Sequence[ - Union[ - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1", - "NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2", - ] -======= - notebook_selector: List[ - Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] ->>>>>>> 1a6f18e (vNext LSP) - ] = attrs.field() - """The notebooks to be synced""" - - save: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether save notification should be forwarded to - the server. Will only be honored if mode === `notebook`.""" - - id: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The id used to register the request. The id can be used to deregister - the request again. See also Registration#id.""" - - -@attrs.define -class WorkspaceOptions: - """Defines workspace specific capabilities of the server. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - workspace_folders: Optional["WorkspaceFoldersServerCapabilities"] = attrs.field( - default=None - ) - """The server supports workspace folder. - - @since 3.6.0""" - # Since: 3.6.0 - - file_operations: Optional["FileOperationOptions"] = attrs.field(default=None) - """The server is interested in notifications/requests for operations on files. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class TextDocumentContentChangePartial: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - range: Range = attrs.field() - """The range of the document that changed.""" - - text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The new text for the provided range.""" - - range_length: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The optional length of the range that got replaced. - - @deprecated use range instead.""" - - -@attrs.define -class TextDocumentContentChangeWholeDocument: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - text: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The new text of the whole document.""" - - -@attrs.define -class CodeDescription: - """Structure to capture a description for an error code. - - @since 3.16.0""" - - # Since: 3.16.0 - - href: str = attrs.field(validator=attrs.validators.instance_of(str)) - """An URI to open with more information about the diagnostic error.""" - - -@attrs.define -class DiagnosticRelatedInformation: - """Represents a related message and source code location for a diagnostic. This should be - used to point to code locations that cause or related to a diagnostics, e.g when duplicating - a symbol in a scope.""" - - location: Location = attrs.field() - """The location of this related diagnostic information.""" - - message: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The message of this related diagnostic information.""" - - -@attrs.define -class EditRangeWithInsertReplace: - """Edit range variant that includes ranges for insert and replace operations. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - insert: Range = attrs.field() - - replace: Range = attrs.field() - - -@attrs.define -class ServerCompletionItemOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - label_details_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server has support for completion item label - details (see also `CompletionItemLabelDetails`) when - receiving a completion item in a resolve call. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class MarkedStringWithLanguage: - """@since 3.18.0 - @proposed - @deprecated use MarkupContent instead.""" - - # Since: 3.18.0 - # Proposed - - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - value: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class ParameterInformation: - """Represents a parameter of a callable-signature. A parameter can - have a label and a doc-comment.""" - - label: Union[str, Tuple[int, int]] = attrs.field() - """The label of this parameter information. - - Either a string or an inclusive start and exclusive end offsets within its containing - signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 - string representation as `Position` and `Range` does. - - *Note*: a label of type string should be a substring of its containing signature label. - Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.""" - - documentation: Optional[Union[str, MarkupContent]] = attrs.field(default=None) - """The human-readable doc-comment of this parameter. Will be shown - in the UI but can be omitted.""" - - -@attrs.define -class NotebookCellTextDocumentFilter: - """A notebook cell text document filter denotes a cell text - document by different properties. - - @since 3.17.0""" - - # Since: 3.17.0 - - notebook: Union[str, NotebookDocumentFilter] = attrs.field() - """A filter that matches against the notebook - containing the notebook cell. If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - language: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A language id like `python`. - - Will be matched against the language id of the - notebook cell document. '*' matches every language.""" - - -@attrs.define -class FileOperationPatternOptions: - """Matching options for the file operation pattern. - - @since 3.16.0""" - - # Since: 3.16.0 - - ignore_case: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The pattern should be matched ignoring casing.""" - - -@attrs.define -class ExecutionSummary: - execution_order: int = attrs.field(validator=validators.uinteger_validator) - """A strict monotonically increasing value - indicating the execution order of a cell - inside a notebook.""" - - success: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the execution was successful or - not if known by the client.""" - - -@attrs.define -class NotebookDocumentCellChangeStructure: - """Structural changes to cells in a notebook document. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - array: "NotebookCellArrayChange" = attrs.field() - """The change to the cell array.""" - - did_open: Optional[List[TextDocumentItem]] = attrs.field(default=None) - """Additional opened cell text documents.""" - - did_close: Optional[List[TextDocumentIdentifier]] = attrs.field(default=None) - """Additional closed cell text documents.""" - - -@attrs.define -class NotebookDocumentCellContentChanges: - """Content changes to a cell in a notebook document. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - document: VersionedTextDocumentIdentifier = attrs.field() - - changes: List[TextDocumentContentChangeEvent] = attrs.field() - - -@attrs.define -class WorkspaceClientCapabilities: - """Workspace specific client capabilities.""" - - apply_edit: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports applying batch edits - to the workspace by supporting the request - 'workspace/applyEdit'""" - - workspace_edit: Optional["WorkspaceEditClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to `WorkspaceEdit`s.""" - - did_change_configuration: Optional[ - "DidChangeConfigurationClientCapabilities" - ] = attrs.field(default=None) - """Capabilities specific to the `workspace/didChangeConfiguration` notification.""" - - did_change_watched_files: Optional[ - "DidChangeWatchedFilesClientCapabilities" - ] = attrs.field(default=None) - """Capabilities specific to the `workspace/didChangeWatchedFiles` notification.""" - - symbol: Optional["WorkspaceSymbolClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `workspace/symbol` request.""" - - execute_command: Optional["ExecuteCommandClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `workspace/executeCommand` request.""" - - workspace_folders: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for workspace folders. - - @since 3.6.0""" - # Since: 3.6.0 - - configuration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports `workspace/configuration` requests. - - @since 3.6.0""" - # Since: 3.6.0 - - semantic_tokens: Optional[ - "SemanticTokensWorkspaceClientCapabilities" - ] = attrs.field(default=None) - """Capabilities specific to the semantic token requests scoped to the - workspace. - - @since 3.16.0.""" - # Since: 3.16.0. - - code_lens: Optional["CodeLensWorkspaceClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the code lens requests scoped to the - workspace. - - @since 3.16.0.""" - # Since: 3.16.0. - - file_operations: Optional["FileOperationClientCapabilities"] = attrs.field( - default=None - ) - """The client has support for file notifications/requests for user operations on files. - - Since 3.16.0""" - - inline_value: Optional["InlineValueWorkspaceClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the inline values requests scoped to the - workspace. - - @since 3.17.0.""" - # Since: 3.17.0. - - inlay_hint: Optional["InlayHintWorkspaceClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the inlay hint requests scoped to the - workspace. - - @since 3.17.0.""" - # Since: 3.17.0. - - diagnostics: Optional["DiagnosticWorkspaceClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the diagnostic requests scoped to the - workspace. - - @since 3.17.0.""" - # Since: 3.17.0. - - folding_range: Optional["FoldingRangeWorkspaceClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the folding range requests scoped to the workspace. - - @since 3.18.0 - @proposed""" - # Since: 3.18.0 - # Proposed - - -@attrs.define -class TextDocumentClientCapabilities: - """Text document specific client capabilities.""" - - synchronization: Optional["TextDocumentSyncClientCapabilities"] = attrs.field( - default=None - ) - """Defines which synchronization capabilities the client supports.""" - - completion: Optional["CompletionClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/completion` request.""" - - hover: Optional["HoverClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/hover` request.""" - - signature_help: Optional["SignatureHelpClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/signatureHelp` request.""" - - declaration: Optional["DeclarationClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/declaration` request. - - @since 3.14.0""" - # Since: 3.14.0 - - definition: Optional["DefinitionClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/definition` request.""" - - type_definition: Optional["TypeDefinitionClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/typeDefinition` request. - - @since 3.6.0""" - # Since: 3.6.0 - - implementation: Optional["ImplementationClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/implementation` request. - - @since 3.6.0""" - # Since: 3.6.0 - - references: Optional["ReferenceClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/references` request.""" - - document_highlight: Optional["DocumentHighlightClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/documentHighlight` request.""" - - document_symbol: Optional["DocumentSymbolClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/documentSymbol` request.""" - - code_action: Optional["CodeActionClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/codeAction` request.""" - - code_lens: Optional["CodeLensClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/codeLens` request.""" - - document_link: Optional["DocumentLinkClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/documentLink` request.""" - - color_provider: Optional["DocumentColorClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/documentColor` and the - `textDocument/colorPresentation` request. - - @since 3.6.0""" - # Since: 3.6.0 - - formatting: Optional["DocumentFormattingClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/formatting` request.""" - - range_formatting: Optional[ - "DocumentRangeFormattingClientCapabilities" - ] = attrs.field(default=None) - """Capabilities specific to the `textDocument/rangeFormatting` request.""" - - on_type_formatting: Optional[ - "DocumentOnTypeFormattingClientCapabilities" - ] = attrs.field(default=None) - """Capabilities specific to the `textDocument/onTypeFormatting` request.""" - - rename: Optional["RenameClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/rename` request.""" - - folding_range: Optional["FoldingRangeClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/foldingRange` request. - - @since 3.10.0""" - # Since: 3.10.0 - - selection_range: Optional["SelectionRangeClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/selectionRange` request. - - @since 3.15.0""" - # Since: 3.15.0 - - publish_diagnostics: Optional["PublishDiagnosticsClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the `textDocument/publishDiagnostics` notification.""" - - call_hierarchy: Optional["CallHierarchyClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the various call hierarchy requests. - - @since 3.16.0""" - # Since: 3.16.0 - - semantic_tokens: Optional["SemanticTokensClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the various semantic token request. - - @since 3.16.0""" - # Since: 3.16.0 - - linked_editing_range: Optional[ - "LinkedEditingRangeClientCapabilities" - ] = attrs.field(default=None) - """Capabilities specific to the `textDocument/linkedEditingRange` request. - - @since 3.16.0""" - # Since: 3.16.0 - - moniker: Optional["MonikerClientCapabilities"] = attrs.field(default=None) - """Client capabilities specific to the `textDocument/moniker` request. - - @since 3.16.0""" - # Since: 3.16.0 - - type_hierarchy: Optional["TypeHierarchyClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the various type hierarchy requests. - - @since 3.17.0""" - # Since: 3.17.0 - - inline_value: Optional["InlineValueClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/inlineValue` request. - - @since 3.17.0""" - # Since: 3.17.0 - - inlay_hint: Optional["InlayHintClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the `textDocument/inlayHint` request. - - @since 3.17.0""" - # Since: 3.17.0 - - diagnostic: Optional["DiagnosticClientCapabilities"] = attrs.field(default=None) - """Capabilities specific to the diagnostic pull model. - - @since 3.17.0""" - # Since: 3.17.0 - - inline_completion: Optional["InlineCompletionClientCapabilities"] = attrs.field( - default=None - ) - """Client capabilities specific to inline completions. - - @since 3.18.0 - @proposed""" - # Since: 3.18.0 - # Proposed - - -@attrs.define -class NotebookDocumentClientCapabilities: - """Capabilities specific to the notebook document support. - - @since 3.17.0""" - - # Since: 3.17.0 - - synchronization: "NotebookDocumentSyncClientCapabilities" = attrs.field() - """Capabilities specific to notebook document synchronization - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class WindowClientCapabilities: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """It indicates whether the client supports server initiated - progress using the `window/workDoneProgress/create` request. - - The capability also controls Whether client supports handling - of progress notifications. If set servers are allowed to report a - `workDoneProgress` property in the request specific server - capabilities. - - @since 3.15.0""" - # Since: 3.15.0 - - show_message: Optional["ShowMessageRequestClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the showMessage request. - - @since 3.16.0""" - # Since: 3.16.0 - - show_document: Optional["ShowDocumentClientCapabilities"] = attrs.field( - default=None - ) - """Capabilities specific to the showDocument request. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -<<<<<<< HEAD -class GeneralClientCapabilitiesStaleRequestSupportType: - cancel: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """The client will actively cancel the request.""" - - retry_on_content_modified: Sequence[str] = attrs.field() - """The list of requests for which the client - will retry the request if it receives a - response with error code `ContentModified`""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class GeneralClientCapabilities: - """General client capabilities. - - @since 3.16.0""" - - # Since: 3.16.0 - - stale_request_support: Optional["StaleRequestSupportOptions"] = attrs.field( - default=None - ) - """Client capability that signals how the client - handles stale requests (e.g. a request - for which the client will not process the response - anymore since the information is outdated). - - @since 3.17.0""" - # Since: 3.17.0 - - regular_expressions: Optional["RegularExpressionsClientCapabilities"] = attrs.field( - default=None - ) - """Client capabilities specific to regular expressions. - - @since 3.16.0""" - # Since: 3.16.0 - - markdown: Optional["MarkdownClientCapabilities"] = attrs.field(default=None) - """Client capabilities specific to the client's markdown parser. - - @since 3.16.0""" - # Since: 3.16.0 - - position_encodings: Optional[ - Sequence[Union[PositionEncodingKind, str]] - ] = attrs.field(default=None) - """The position encodings supported by the client. Client and server - have to agree on the same position encoding to ensure that offsets - (e.g. character position in a line) are interpreted the same on both - sides. - - To keep the protocol backwards compatible the following applies: if - the value 'utf-16' is missing from the array of position encodings - servers can assume that the client supports UTF-16. UTF-16 is - therefore a mandatory encoding. - - If omitted it defaults to ['utf-16']. - - Implementation considerations: since the conversion from one encoding - into another requires the content of the file / line the conversion - is best done where the file is read which is usually on the server - side. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class NotebookDocumentFilterWithNotebook: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - notebook: Union[str, NotebookDocumentFilter] = attrs.field() - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - cells: Optional[List["NotebookCellLanguage"]] = attrs.field(default=None) - """The cells of the matching notebook to be synced.""" - - -@attrs.define -class NotebookDocumentFilterWithCells: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - cells: List["NotebookCellLanguage"] = attrs.field() - """The cells of the matching notebook to be synced.""" - - notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) - """The notebook to be synced If a string - value is provided it matches against the - notebook type. '*' matches every notebook.""" - - -@attrs.define -class WorkspaceFoldersServerCapabilities: - supported: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The server has support for workspace folders""" - - change_notifications: Optional[Union[str, bool]] = attrs.field(default=None) - """Whether the server wants to receive workspace folder - change notifications. - - If a string is provided the string is treated as an ID - under which the notification is registered on the client - side. The ID can be used to unregister for these events - using the `client/unregisterCapability` request.""" - - -@attrs.define -class FileOperationOptions: - """Options for notifications/requests for user operations on files. - - @since 3.16.0""" - - # Since: 3.16.0 - - did_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving didCreateFiles notifications.""" - - will_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving willCreateFiles requests.""" - - did_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving didRenameFiles notifications.""" - - will_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving willRenameFiles requests.""" - - did_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving didDeleteFiles file notifications.""" - - will_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving willDeleteFiles file requests.""" - - -@attrs.define -class RelativePattern: - """A relative pattern is a helper to construct glob patterns that are matched - relatively to a base URI. The common value for a `baseUri` is a workspace - folder root, but it can be another absolute URI as well. - - @since 3.17.0""" - - # Since: 3.17.0 - - base_uri: Union[WorkspaceFolder, str] = attrs.field() - """A workspace folder or a base URI to which this pattern will be matched - against relatively.""" - - pattern: Pattern = attrs.field() - """The actual glob pattern;""" - - -@attrs.define -class TextDocumentFilterLanguage: - """A document filter where `language` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A language id, like `typescript`.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" - - -@attrs.define -class TextDocumentFilterScheme: - """A document filter where `scheme` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - language: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A language id, like `typescript`.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" - - -@attrs.define -class TextDocumentFilterPattern: - """A document filter where `pattern` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" - - language: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A language id, like `typescript`.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - -@attrs.define -class NotebookCellArrayChange: - """A change describing how to move a `NotebookCell` - array from state S to S'. - - @since 3.17.0""" - - # Since: 3.17.0 - - start: int = attrs.field(validator=validators.uinteger_validator) - """The start oftest of the cell that changed.""" - - delete_count: int = attrs.field(validator=validators.uinteger_validator) - """The deleted cells""" - - cells: Optional[List[NotebookCell]] = attrs.field(default=None) - """The new cells, if any""" - - -@attrs.define -class WorkspaceEditClientCapabilities: - document_changes: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports versioned document changes in `WorkspaceEdit`s""" - - resource_operations: Optional[Sequence[ResourceOperationKind]] = attrs.field( - default=None - ) - """The resource operations the client supports. Clients should at least - support 'create', 'rename' and 'delete' files and folders. - - @since 3.13.0""" - # Since: 3.13.0 - - failure_handling: Optional[FailureHandlingKind] = attrs.field(default=None) - """The failure handling strategy of a client if applying the workspace edit - fails. - - @since 3.13.0""" - # Since: 3.13.0 - - normalizes_line_endings: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client normalizes line endings to the client specific - setting. - If set to `true` the client will normalize line ending characters - in a workspace edit to the client-specified new line - character. - - @since 3.16.0""" - # Since: 3.16.0 - - change_annotation_support: Optional[ - "ChangeAnnotationsSupportOptions" - ] = attrs.field(default=None) - """Whether the client in general supports change annotations on text edits, - create file, rename file and delete file changes. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class DidChangeConfigurationClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Did change configuration notification supports dynamic registration.""" - - -@attrs.define -class DidChangeWatchedFilesClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Did change watched files notification supports dynamic registration. Please note - that the current protocol doesn't support static configuration for file changes - from the server side.""" - - relative_pattern_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client has support for {@link RelativePattern relative pattern} - or not. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -<<<<<<< HEAD -class WorkspaceSymbolClientCapabilitiesSymbolKindType: - value_set: Optional[Sequence[SymbolKind]] = attrs.field(default=None) - """The symbol kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown. - - If this property is not present the client only supports - the symbol kinds from `File` to `Array` as defined in - the initial version of the protocol.""" - - -@attrs.define -class WorkspaceSymbolClientCapabilitiesTagSupportType: - value_set: Sequence[SymbolTag] = attrs.field() - """The tags supported by the client.""" - - -@attrs.define -class WorkspaceSymbolClientCapabilitiesResolveSupportType: - properties: Sequence[str] = attrs.field() - """The properties that a client can resolve lazily. Usually - `location.range`""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class WorkspaceSymbolClientCapabilities: - """Client capabilities for a {@link WorkspaceSymbolRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Symbol request supports dynamic registration.""" - - symbol_kind: Optional["ClientSymbolKindOptions"] = attrs.field(default=None) - """Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.""" - - tag_support: Optional["ClientSymbolTagOptions"] = attrs.field(default=None) - """The client supports tags on `SymbolInformation`. - Clients supporting tags have to handle unknown tags gracefully. - - @since 3.16.0""" - # Since: 3.16.0 - - resolve_support: Optional["ClientSymbolResolveOptions"] = attrs.field(default=None) - """The client support partial workspace symbols. The client will send the - request `workspaceSymbol/resolve` to the server to resolve additional - properties. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class ExecuteCommandClientCapabilities: - """The client capabilities of a {@link ExecuteCommandRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Execute command supports dynamic registration.""" - - -@attrs.define -class SemanticTokensWorkspaceClientCapabilities: - """@since 3.16.0""" - - # Since: 3.16.0 - - refresh_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client implementation supports a refresh request sent from - the server to the client. - - Note that this event is global and will force the client to refresh all - semantic tokens currently shown. It should be used with absolute care - and is useful for situation where a server for example detects a project - wide change that requires such a calculation.""" - - -@attrs.define -class CodeLensWorkspaceClientCapabilities: - """@since 3.16.0""" - - # Since: 3.16.0 - - refresh_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client implementation supports a refresh request sent from the - server to the client. - - Note that this event is global and will force the client to refresh all - code lenses currently shown. It should be used with absolute care and is - useful for situation where a server for example detect a project wide - change that requires such a calculation.""" - - -@attrs.define -class FileOperationClientCapabilities: - """Capabilities relating to events from file operations by the user in the client. - - These events do not come from the file system, they come from user operations - like renaming a file in the UI. - - @since 3.16.0""" - - # Since: 3.16.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client supports dynamic registration for file requests/notifications.""" - - did_create: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for sending didCreateFiles notifications.""" - - will_create: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for sending willCreateFiles requests.""" - - did_rename: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for sending didRenameFiles notifications.""" - - will_rename: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for sending willRenameFiles requests.""" - - did_delete: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for sending didDeleteFiles notifications.""" - - will_delete: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for sending willDeleteFiles requests.""" - - -@attrs.define -class InlineValueWorkspaceClientCapabilities: - """Client workspace capabilities specific to inline values. - - @since 3.17.0""" - - # Since: 3.17.0 - - refresh_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client implementation supports a refresh request sent from the - server to the client. - - Note that this event is global and will force the client to refresh all - inline values currently shown. It should be used with absolute care and is - useful for situation where a server for example detects a project wide - change that requires such a calculation.""" - - -@attrs.define -class InlayHintWorkspaceClientCapabilities: - """Client workspace capabilities specific to inlay hints. - - @since 3.17.0""" - - # Since: 3.17.0 - - refresh_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client implementation supports a refresh request sent from - the server to the client. - - Note that this event is global and will force the client to refresh all - inlay hints currently shown. It should be used with absolute care and - is useful for situation where a server for example detects a project wide - change that requires such a calculation.""" - - -@attrs.define -class DiagnosticWorkspaceClientCapabilities: - """Workspace client capabilities specific to diagnostic pull requests. - - @since 3.17.0""" - - # Since: 3.17.0 - - refresh_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client implementation supports a refresh request sent from - the server to the client. - - Note that this event is global and will force the client to refresh all - pulled diagnostics currently shown. It should be used with absolute care and - is useful for situation where a server for example detects a project wide - change that requires such a calculation.""" - - -@attrs.define -class FoldingRangeWorkspaceClientCapabilities: - """Client workspace capabilities specific to folding ranges - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - refresh_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client implementation supports a refresh request sent from the - server to the client. - - Note that this event is global and will force the client to refresh all - folding ranges currently shown. It should be used with absolute care and is - useful for situation where a server for example detects a project wide - change that requires such a calculation. - - @since 3.18.0 - @proposed""" - # Since: 3.18.0 - # Proposed - - -@attrs.define -class TextDocumentSyncClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether text document synchronization supports dynamic registration.""" - - will_save: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports sending will save notifications.""" - - will_save_wait_until: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports sending a will save request and - waits for a response providing text edits which will - be applied to the document before it is saved.""" - - did_save: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports did save notifications.""" - - -@attrs.define -<<<<<<< HEAD -class CompletionClientCapabilitiesCompletionItemTypeTagSupportType: - value_set: Sequence[CompletionItemTag] = attrs.field() - """The tags supported by the client.""" - - -@attrs.define -class CompletionClientCapabilitiesCompletionItemTypeResolveSupportType: - properties: Sequence[str] = attrs.field() - """The properties that a client can resolve lazily.""" - - -@attrs.define -class CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType: - value_set: Sequence[InsertTextMode] = attrs.field() - - -@attrs.define -class CompletionClientCapabilitiesCompletionItemType: - snippet_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports snippets as insert text. - - A snippet can define tab stops and placeholders with `$1`, `$2` - and `${3:foo}`. `$0` defines the final tab stop, it defaults to - the end of the snippet. Placeholders with equal identifiers are linked, - that is typing in one will update others too.""" - - commit_characters_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports commit characters on a completion item.""" - - documentation_format: Optional[Sequence[MarkupKind]] = attrs.field(default=None) - """Client supports the following content formats for the documentation - property. The order describes the preferred format of the client.""" - - deprecated_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports the deprecated property on a completion item.""" - - preselect_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports the preselect property on a completion item.""" - - tag_support: Optional[ - "CompletionClientCapabilitiesCompletionItemTypeTagSupportType" - ] = attrs.field(default=None) - """Client supports the tag property on a completion item. Clients supporting - tags have to handle unknown tags gracefully. Clients especially need to - preserve unknown tags when sending a completion item back to the server in - a resolve call. - - @since 3.15.0""" - # Since: 3.15.0 - - insert_replace_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client support insert replace edit to control different behavior if a - completion item is inserted in the text or should replace text. - - @since 3.16.0""" - # Since: 3.16.0 - - resolve_support: Optional[ - "CompletionClientCapabilitiesCompletionItemTypeResolveSupportType" - ] = attrs.field(default=None) - """Indicates which properties a client can resolve lazily on a completion - item. Before version 3.16.0 only the predefined properties `documentation` - and `details` could be resolved lazily. - - @since 3.16.0""" - # Since: 3.16.0 - - insert_text_mode_support: Optional[ - "CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType" - ] = attrs.field(default=None) - """The client supports the `insertTextMode` property on - a completion item to override the whitespace handling mode - as defined by the client (see `insertTextMode`). - - @since 3.16.0""" - # Since: 3.16.0 - - label_details_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for completion item label - details (see also `CompletionItemLabelDetails`). - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class CompletionClientCapabilitiesCompletionItemKindType: - value_set: Optional[Sequence[CompletionItemKind]] = attrs.field(default=None) - """The completion item kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown. - - If this property is not present the client only supports - the completion items kinds from `Text` to `Reference` as defined in - the initial version of the protocol.""" - - -@attrs.define -class CompletionClientCapabilitiesCompletionListType: - item_defaults: Optional[Sequence[str]] = attrs.field(default=None) - """The client supports the following itemDefaults on - a completion list. - - The value lists the supported property names of the - `CompletionList.itemDefaults` object. If omitted - no properties are supported. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class CompletionClientCapabilities: - """Completion client capabilities""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether completion supports dynamic registration.""" - - completion_item: Optional["ClientCompletionItemOptions"] = attrs.field(default=None) - """The client supports the following `CompletionItem` specific - capabilities.""" - - completion_item_kind: Optional["ClientCompletionItemOptionsKind"] = attrs.field( - default=None - ) - - insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) - """Defines how the client handles whitespace and indentation - when accepting a completion item that uses multi line - text in either `insertText` or `textEdit`. - - @since 3.17.0""" - # Since: 3.17.0 - - context_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports to send additional context information for a - `textDocument/completion` request.""" - - completion_list: Optional["CompletionListCapabilities"] = attrs.field(default=None) - """The client supports the following `CompletionList` specific - capabilities. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class HoverClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether hover supports dynamic registration.""" - - content_format: Optional[Sequence[MarkupKind]] = attrs.field(default=None) - """Client supports the following content formats for the content - property. The order describes the preferred format of the client.""" - - -@attrs.define -<<<<<<< HEAD -class SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType: - label_offset_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports processing label offsets instead of a - simple label string. - - @since 3.14.0""" - # Since: 3.14.0 - - -@attrs.define -class SignatureHelpClientCapabilitiesSignatureInformationType: - documentation_format: Optional[Sequence[MarkupKind]] = attrs.field(default=None) - """Client supports the following content formats for the documentation - property. The order describes the preferred format of the client.""" - - parameter_information: Optional[ - "SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType" - ] = attrs.field(default=None) - """Client capabilities specific to parameter information.""" - - active_parameter_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports the `activeParameter` property on `SignatureInformation` - literal. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class SignatureHelpClientCapabilities: - """Client Capabilities for a {@link SignatureHelpRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether signature help supports dynamic registration.""" - - signature_information: Optional["ClientSignatureInformationOptions"] = attrs.field( - default=None - ) - """The client supports the following `SignatureInformation` - specific properties.""" - - context_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports to send additional context information for a - `textDocument/signatureHelp` request. A client that opts into - contextSupport will also support the `retriggerCharacters` on - `SignatureHelpOptions`. - - @since 3.15.0""" - # Since: 3.15.0 - - -@attrs.define -class DeclarationClientCapabilities: - """@since 3.14.0""" - - # Since: 3.14.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether declaration supports dynamic registration. If this is set to `true` - the client supports the new `DeclarationRegistrationOptions` return value - for the corresponding server capability as well.""" - - link_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports additional metadata in the form of declaration links.""" - - -@attrs.define -class DefinitionClientCapabilities: - """Client Capabilities for a {@link DefinitionRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether definition supports dynamic registration.""" - - link_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports additional metadata in the form of definition links. - - @since 3.14.0""" - # Since: 3.14.0 - - -@attrs.define -class TypeDefinitionClientCapabilities: - """Since 3.6.0""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `TypeDefinitionRegistrationOptions` return value - for the corresponding server capability as well.""" - - link_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports additional metadata in the form of definition links. - - Since 3.14.0""" - - -@attrs.define -class ImplementationClientCapabilities: - """@since 3.6.0""" - - # Since: 3.6.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `ImplementationRegistrationOptions` return value - for the corresponding server capability as well.""" - - link_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports additional metadata in the form of definition links. - - @since 3.14.0""" - # Since: 3.14.0 - - -@attrs.define -class ReferenceClientCapabilities: - """Client Capabilities for a {@link ReferencesRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether references supports dynamic registration.""" - - -@attrs.define -class DocumentHighlightClientCapabilities: - """Client Capabilities for a {@link DocumentHighlightRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether document highlight supports dynamic registration.""" - - -@attrs.define -<<<<<<< HEAD -class DocumentSymbolClientCapabilitiesSymbolKindType: - value_set: Optional[Sequence[SymbolKind]] = attrs.field(default=None) - """The symbol kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown. - - If this property is not present the client only supports - the symbol kinds from `File` to `Array` as defined in - the initial version of the protocol.""" - - -@attrs.define -class DocumentSymbolClientCapabilitiesTagSupportType: - value_set: Sequence[SymbolTag] = attrs.field() - """The tags supported by the client.""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class DocumentSymbolClientCapabilities: - """Client Capabilities for a {@link DocumentSymbolRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether document symbol supports dynamic registration.""" - - symbol_kind: Optional["ClientSymbolKindOptions"] = attrs.field(default=None) - """Specific capabilities for the `SymbolKind` in the - `textDocument/documentSymbol` request.""" - - hierarchical_document_symbol_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports hierarchical document symbols.""" - - tag_support: Optional["ClientSymbolTagOptions"] = attrs.field(default=None) - """The client supports tags on `SymbolInformation`. Tags are supported on - `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - Clients supporting tags have to handle unknown tags gracefully. - - @since 3.16.0""" - # Since: 3.16.0 - - label_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports an additional label presented in the UI when - registering a document symbol provider. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -<<<<<<< HEAD -class CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType: - value_set: Sequence[Union[CodeActionKind, str]] = attrs.field() - """The code action kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown.""" - - -@attrs.define -class CodeActionClientCapabilitiesCodeActionLiteralSupportType: - code_action_kind: "CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType" = ( - attrs.field() - ) - """The code action kind is support with the following value - set.""" - - -@attrs.define -class CodeActionClientCapabilitiesResolveSupportType: - properties: Sequence[str] = attrs.field() - """The properties that a client can resolve lazily.""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class CodeActionClientCapabilities: - """The Client Capabilities of a {@link CodeActionRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether code action supports dynamic registration.""" - - code_action_literal_support: Optional[ - "ClientCodeActionLiteralOptions" - ] = attrs.field(default=None) - """The client support code action literals of type `CodeAction` as a valid - response of the `textDocument/codeAction` request. If the property is not - set the request can only return `Command` literals. - - @since 3.8.0""" - # Since: 3.8.0 - - is_preferred_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether code action supports the `isPreferred` property. - - @since 3.15.0""" - # Since: 3.15.0 - - disabled_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether code action supports the `disabled` property. - - @since 3.16.0""" - # Since: 3.16.0 - - data_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether code action supports the `data` property which is - preserved between a `textDocument/codeAction` and a - `codeAction/resolve` request. - - @since 3.16.0""" - # Since: 3.16.0 - - resolve_support: Optional["ClientCodeActionResolveOptions"] = attrs.field( - default=None - ) - """Whether the client supports resolving additional code action - properties via a separate `codeAction/resolve` request. - - @since 3.16.0""" - # Since: 3.16.0 - - honors_change_annotations: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client honors the change annotations in - text edits and resource operations returned via the - `CodeAction#edit` property by for example presenting - the workspace edit in the user interface and asking - for confirmation. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class CodeLensClientCapabilities: - """The client capabilities of a {@link CodeLensRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether code lens supports dynamic registration.""" - - -@attrs.define -class DocumentLinkClientCapabilities: - """The client capabilities of a {@link DocumentLinkRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether document link supports dynamic registration.""" - - tooltip_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client supports the `tooltip` property on `DocumentLink`. - - @since 3.15.0""" - # Since: 3.15.0 - - -@attrs.define -class DocumentColorClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `DocumentColorRegistrationOptions` return value - for the corresponding server capability as well.""" - - -@attrs.define -class DocumentFormattingClientCapabilities: - """Client capabilities of a {@link DocumentFormattingRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether formatting supports dynamic registration.""" - - -@attrs.define -class DocumentRangeFormattingClientCapabilities: - """Client capabilities of a {@link DocumentRangeFormattingRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether range formatting supports dynamic registration.""" - - ranges_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client supports formatting multiple ranges at once. - - @since 3.18.0 - @proposed""" - # Since: 3.18.0 - # Proposed - - -@attrs.define -class DocumentOnTypeFormattingClientCapabilities: - """Client capabilities of a {@link DocumentOnTypeFormattingRequest}.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether on type formatting supports dynamic registration.""" - - -@attrs.define -class RenameClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether rename supports dynamic registration.""" - - prepare_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports testing for validity of rename operations - before execution. - - @since 3.12.0""" - # Since: 3.12.0 - - prepare_support_default_behavior: Optional[ - PrepareSupportDefaultBehavior - ] = attrs.field(default=None) - """Client supports the default behavior result. - - The value indicates the default behavior used by the - client. - - @since 3.16.0""" - # Since: 3.16.0 - - honors_change_annotations: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client honors the change annotations in - text edits and resource operations returned via the - rename request's workspace edit by for example presenting - the workspace edit in the user interface and asking - for confirmation. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -<<<<<<< HEAD -class FoldingRangeClientCapabilitiesFoldingRangeKindType: - value_set: Optional[Sequence[Union[FoldingRangeKind, str]]] = attrs.field( - default=None - ) - """The folding range kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown.""" - - -@attrs.define -class FoldingRangeClientCapabilitiesFoldingRangeType: - collapsed_text: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """If set, the client signals that it supports setting collapsedText on - folding ranges to display custom labels instead of the default text. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class FoldingRangeClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration for folding range - providers. If this is set to `true` the client supports the new - `FoldingRangeRegistrationOptions` return value for the corresponding - server capability as well.""" - - range_limit: Optional[int] = attrs.field( - validator=attrs.validators.optional(validators.uinteger_validator), default=None - ) - """The maximum number of folding ranges that the client prefers to receive - per document. The value serves as a hint, servers are free to follow the - limit.""" - - line_folding_only: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """If set, the client signals that it only supports folding complete lines. - If set, client will ignore specified `startCharacter` and `endCharacter` - properties in a FoldingRange.""" - - folding_range_kind: Optional["ClientFoldingRangeKindOptions"] = attrs.field( - default=None - ) - """Specific options for the folding range kind. - - @since 3.17.0""" - # Since: 3.17.0 - - folding_range: Optional["ClientFoldingRangeOptions"] = attrs.field(default=None) - """Specific options for the folding range. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class SelectionRangeClientCapabilities: - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration for selection range providers. If this is set to `true` - the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server - capability as well.""" - - -@attrs.define -<<<<<<< HEAD -class PublishDiagnosticsClientCapabilitiesTagSupportType: - value_set: Sequence[DiagnosticTag] = attrs.field() - """The tags supported by the client.""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class PublishDiagnosticsClientCapabilities: - """The publish diagnostic client capabilities.""" - - related_information: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the clients accepts diagnostics with related information.""" - - tag_support: Optional["ClientDiagnosticsTagOptions"] = attrs.field(default=None) - """Client supports the tag property to provide meta data about a diagnostic. - Clients supporting tags have to handle unknown tags gracefully. - - @since 3.15.0""" - # Since: 3.15.0 - - version_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client interprets the version property of the - `textDocument/publishDiagnostics` notification's parameter. - - @since 3.15.0""" - # Since: 3.15.0 - - code_description_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports a codeDescription property - - @since 3.16.0""" - # Since: 3.16.0 - - data_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether code action supports the `data` property which is - preserved between a `textDocument/publishDiagnostics` and - `textDocument/codeAction` request. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class CallHierarchyClientCapabilities: - """@since 3.16.0""" - - # Since: 3.16.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - return value for the corresponding server capability as well.""" - - -@attrs.define -class SemanticTokensClientCapabilities: - """@since 3.16.0""" - - # Since: 3.16.0 - - requests: "ClientSemanticTokensRequestOptions" = attrs.field() - """Which requests the client supports and might send to the server - depending on the server's capability. Please note that clients might not - show semantic tokens or degrade some of the user experience if a range - or full request is advertised by the client but not provided by the - server. If for example the client capability `requests.full` and - `request.range` are both set to true but the server only provides a - range provider the client might not render a minimap correctly or might - even decide to not show any semantic tokens at all.""" - - token_types: Sequence[str] = attrs.field() - """The token types that the client supports.""" - - token_modifiers: Sequence[str] = attrs.field() - """The token modifiers that the client supports.""" - - formats: Sequence[TokenFormat] = attrs.field() - """The token formats the clients supports.""" - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - return value for the corresponding server capability as well.""" - - overlapping_token_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client supports tokens that can overlap each other.""" - - multiline_token_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client supports tokens that can span multiple lines.""" - - server_cancel_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client allows the server to actively cancel a - semantic token request, e.g. supports returning - LSPErrorCodes.ServerCancelled. If a server does the client - needs to retrigger the request. - - @since 3.17.0""" - # Since: 3.17.0 - - augments_syntax_tokens: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client uses semantic tokens to augment existing - syntax tokens. If set to `true` client side created syntax - tokens and semantic tokens are both used for colorization. If - set to `false` the client only uses the returned semantic tokens - for colorization. - - If the value is `undefined` then the client behavior is not - specified. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class LinkedEditingRangeClientCapabilities: - """Client capabilities for the linked editing range request. - - @since 3.16.0""" - - # Since: 3.16.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - return value for the corresponding server capability as well.""" - - -@attrs.define -class MonikerClientCapabilities: - """Client capabilities specific to the moniker request. - - @since 3.16.0""" - - # Since: 3.16.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether moniker supports dynamic registration. If this is set to `true` - the client supports the new `MonikerRegistrationOptions` return value - for the corresponding server capability as well.""" - - -@attrs.define -class TypeHierarchyClientCapabilities: - """@since 3.17.0""" - - # Since: 3.17.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - return value for the corresponding server capability as well.""" - - -@attrs.define -class InlineValueClientCapabilities: - """Client capabilities specific to inline values. - - @since 3.17.0""" - - # Since: 3.17.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration for inline value providers.""" - - -@attrs.define -<<<<<<< HEAD -class InlayHintClientCapabilitiesResolveSupportType: - properties: Sequence[str] = attrs.field() - """The properties that a client can resolve lazily.""" - - -@attrs.define -======= ->>>>>>> 1a6f18e (vNext LSP) -class InlayHintClientCapabilities: - """Inlay hint client capabilities. - - @since 3.17.0""" - - # Since: 3.17.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether inlay hints support dynamic registration.""" - - resolve_support: Optional["ClientInlayHintResolveOptions"] = attrs.field( - default=None - ) - """Indicates which properties a client can resolve lazily on an inlay - hint.""" - - -@attrs.define -class DiagnosticClientCapabilities: - """Client capabilities specific to diagnostic pull requests. - - @since 3.17.0""" - - # Since: 3.17.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is set to `true` - the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - return value for the corresponding server capability as well.""" - - related_document_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the clients supports related documents for document diagnostic pulls.""" - - -@attrs.define -class InlineCompletionClientCapabilities: - """Client capabilities specific to inline completions. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration for inline completion providers.""" - - -@attrs.define -class NotebookDocumentSyncClientCapabilities: - """Notebook specific client capabilities. - - @since 3.17.0""" - - # Since: 3.17.0 - - dynamic_registration: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether implementation supports dynamic registration. If this is - set to `true` the client supports the new - `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - return value for the corresponding server capability as well.""" - - execution_summary_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports sending execution summary data per cell.""" - - -@attrs.define -class ShowMessageRequestClientCapabilities: - """Show message request client capabilities""" - - message_action_item: Optional["ClientShowMessageActionItemOptions"] = attrs.field( - default=None - ) - """Capabilities specific to the `MessageActionItem` type.""" - - -@attrs.define -class ShowDocumentClientCapabilities: - """Client capabilities for the showDocument request. - - @since 3.16.0""" - - # Since: 3.16.0 - - support: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """The client has support for the showDocument - request.""" - - -@attrs.define -class StaleRequestSupportOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - cancel: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """The client will actively cancel the request.""" - - retry_on_content_modified: List[str] = attrs.field() - """The list of requests for which the client - will retry the request if it receives a - response with error code `ContentModified`""" - - -@attrs.define -class RegularExpressionsClientCapabilities: - """Client capabilities specific to regular expressions. - - @since 3.16.0""" - - # Since: 3.16.0 - - engine: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The engine's name.""" - - version: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The engine's version.""" - - -@attrs.define -class MarkdownClientCapabilities: - """Client capabilities specific to the used markdown parser. - - @since 3.16.0""" - - # Since: 3.16.0 - - parser: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The name of the parser.""" - - version: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The version of the parser.""" - - allowed_tags: Optional[Sequence[str]] = attrs.field(default=None) - """A list of HTML tags that the client allows / supports in - Markdown. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class NotebookCellLanguage: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - language: str = attrs.field(validator=attrs.validators.instance_of(str)) - - -@attrs.define -class NotebookDocumentFilterNotebookType: - """A notebook document filter where `notebookType` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The type of the enclosing notebook.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern.""" - - -@attrs.define -class NotebookDocumentFilterScheme: - """A notebook document filter where `scheme` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - notebook_type: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The type of the enclosing notebook.""" - - pattern: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A glob pattern.""" - - -@attrs.define -class NotebookDocumentFilterPattern: - """A notebook document filter where `pattern` is required field. - - @since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A glob pattern.""" - - notebook_type: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """The type of the enclosing notebook.""" - - scheme: Optional[str] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(str)), - default=None, - ) - """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" - - -@attrs.define -class ChangeAnnotationsSupportOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - groups_on_label: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client groups edits with equal labels into tree nodes, - for instance all edits labelled with "Changes in Strings" would - be a tree node.""" - - -@attrs.define -class ClientSymbolKindOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: Optional[List[SymbolKind]] = attrs.field(default=None) - """The symbol kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown. - - If this property is not present the client only supports - the symbol kinds from `File` to `Array` as defined in - the initial version of the protocol.""" - - -@attrs.define -class ClientSymbolTagOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: List[SymbolTag] = attrs.field() - """The tags supported by the client.""" - - -@attrs.define -class ClientSymbolResolveOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - properties: List[str] = attrs.field() - """The properties that a client can resolve lazily. Usually - `location.range`""" - - -@attrs.define -class ClientCompletionItemOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - snippet_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports snippets as insert text. - - A snippet can define tab stops and placeholders with `$1`, `$2` - and `${3:foo}`. `$0` defines the final tab stop, it defaults to - the end of the snippet. Placeholders with equal identifiers are linked, - that is typing in one will update others too.""" - - commit_characters_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports commit characters on a completion item.""" - - documentation_format: Optional[List[MarkupKind]] = attrs.field(default=None) - """Client supports the following content formats for the documentation - property. The order describes the preferred format of the client.""" - - deprecated_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports the deprecated property on a completion item.""" - - preselect_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client supports the preselect property on a completion item.""" - - tag_support: Optional["CompletionItemTagOptions"] = attrs.field(default=None) - """Client supports the tag property on a completion item. Clients supporting - tags have to handle unknown tags gracefully. Clients especially need to - preserve unknown tags when sending a completion item back to the server in - a resolve call. - - @since 3.15.0""" - # Since: 3.15.0 - - insert_replace_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Client support insert replace edit to control different behavior if a - completion item is inserted in the text or should replace text. - - @since 3.16.0""" - # Since: 3.16.0 - - resolve_support: Optional["ClientCompletionItemResolveOptions"] = attrs.field( - default=None - ) - """Indicates which properties a client can resolve lazily on a completion - item. Before version 3.16.0 only the predefined properties `documentation` - and `details` could be resolved lazily. - - @since 3.16.0""" - # Since: 3.16.0 - - insert_text_mode_support: Optional[ - "ClientCompletionItemInsertTextModeOptions" - ] = attrs.field(default=None) - """The client supports the `insertTextMode` property on - a completion item to override the whitespace handling mode - as defined by the client (see `insertTextMode`). - - @since 3.16.0""" - # Since: 3.16.0 - - label_details_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client has support for completion item label - details (see also `CompletionItemLabelDetails`). - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class ClientCompletionItemOptionsKind: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: Optional[List[CompletionItemKind]] = attrs.field(default=None) - """The completion item kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown. - - If this property is not present the client only supports - the completion items kinds from `Text` to `Reference` as defined in - the initial version of the protocol.""" - - -@attrs.define -class CompletionListCapabilities: - """The client supports the following `CompletionList` specific - capabilities. - - @since 3.17.0""" - - # Since: 3.17.0 - - item_defaults: Optional[List[str]] = attrs.field(default=None) - """The client supports the following itemDefaults on - a completion list. - - The value lists the supported property names of the - `CompletionList.itemDefaults` object. If omitted - no properties are supported. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class ClientSignatureInformationOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - documentation_format: Optional[List[MarkupKind]] = attrs.field(default=None) - """Client supports the following content formats for the documentation - property. The order describes the preferred format of the client.""" - - parameter_information: Optional[ - "ClientSignatureParameterInformationOptions" - ] = attrs.field(default=None) - """Client capabilities specific to parameter information.""" - - active_parameter_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports the `activeParameter` property on `SignatureInformation` - literal. - - @since 3.16.0""" - # Since: 3.16.0 - - -@attrs.define -class ClientCodeActionLiteralOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - code_action_kind: "ClientCodeActionKindOptions" = attrs.field() - """The code action kind is support with the following value - set.""" - - -@attrs.define -class ClientCodeActionResolveOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - properties: List[str] = attrs.field() - """The properties that a client can resolve lazily.""" - - -@attrs.define -class ClientFoldingRangeKindOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: Optional[List[Union[FoldingRangeKind, str]]] = attrs.field(default=None) - """The folding range kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown.""" - - -@attrs.define -class ClientFoldingRangeOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - collapsed_text: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """If set, the client signals that it supports setting collapsedText on - folding ranges to display custom labels instead of the default text. - - @since 3.17.0""" - # Since: 3.17.0 - - -@attrs.define -class ClientDiagnosticsTagOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: List[DiagnosticTag] = attrs.field() - """The tags supported by the client.""" - - -@attrs.define -class ClientSemanticTokensRequestOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - range: Optional[Union[bool, Any]] = attrs.field(default=None) - """The client will send the `textDocument/semanticTokens/range` request if - the server provides a corresponding handler.""" - - full: Optional[Union[bool, "ClientSemanticTokensRequestFullDelta"]] = attrs.field( - default=None - ) - """The client will send the `textDocument/semanticTokens/full` request if - the server provides a corresponding handler.""" - - -@attrs.define -class ClientInlayHintResolveOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - properties: List[str] = attrs.field() - """The properties that a client can resolve lazily.""" - - -@attrs.define -class ClientShowMessageActionItemOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - additional_properties_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """Whether the client supports additional attributes which - are preserved and send back to the server in the - request's response.""" - - -@attrs.define -class CompletionItemTagOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: List[CompletionItemTag] = attrs.field() - """The tags supported by the client.""" - - -@attrs.define -class ClientCompletionItemResolveOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - properties: List[str] = attrs.field() - """The properties that a client can resolve lazily.""" - - -@attrs.define -class ClientCompletionItemInsertTextModeOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: List[InsertTextMode] = attrs.field() - - -@attrs.define -class ClientSignatureParameterInformationOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - label_offset_support: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client supports processing label offsets instead of a - simple label string. - - @since 3.14.0""" - # Since: 3.14.0 - - -@attrs.define -class ClientCodeActionKindOptions: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - value_set: List[Union[CodeActionKind, str]] = attrs.field() - """The code action kind values the client supports. When this - property exists the client also guarantees that it will - handle values outside its set gracefully and falls back - to a default value when unknown.""" - - -@attrs.define -class ClientSemanticTokensRequestFullDelta: - """@since 3.18.0 - @proposed""" - - # Since: 3.18.0 - # Proposed - - delta: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - """The client will send the `textDocument/semanticTokens/full/delta` request if - the server provides a corresponding handler.""" - - -@attrs.define -class TextDocumentColorPresentationOptions: - work_done_progress: Optional[bool] = attrs.field( - validator=attrs.validators.optional(attrs.validators.instance_of(bool)), - default=None, - ) - - document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( - default=None - ) - """A document selector to identify the scope of the registration. If set to null - the document selector provided on the client side will be used.""" - - -@attrs.define -class ResponseError: - code: int = attrs.field(validator=validators.integer_validator) - """A number indicating the error type that occurred.""" - message: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A string providing a short description of the error.""" - data: Optional[LSPAny] = attrs.field(default=None) - """A primitive or structured value that contains additional information - about the error. Can be omitted.""" - - -@attrs.define -class ResponseErrorMessage: - id: Optional[Union[int, str]] = attrs.field(default=None) - """The request id where the error occurred.""" - error: Optional[ResponseError] = attrs.field(default=None) - """The error object in case a request fails.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentImplementationRequest: - """A request to resolve the implementation locations of a symbol at a given text - document position. The request's parameter is of type {@link TextDocumentPositionParams} - the response is of type {@link Definition} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: ImplementationParams = attrs.field() - method: str = "textDocument/implementation" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentImplementationResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Definition, Sequence[DefinitionLink], None] = attrs.field( - default=None - ) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentTypeDefinitionRequest: - """A request to resolve the type definition locations of a symbol at a given text - document position. The request's parameter is of type {@link TextDocumentPositionParams} - the response is of type {@link Definition} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: TypeDefinitionParams = attrs.field() - method: str = "textDocument/typeDefinition" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentTypeDefinitionResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Definition, Sequence[DefinitionLink], None] = attrs.field( - default=None - ) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWorkspaceFoldersRequest: - """The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "workspace/workspaceFolders" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWorkspaceFoldersResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[WorkspaceFolder], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -WorkspaceConfigurationParams = ConfigurationParams - - -@attrs.define -class WorkspaceConfigurationRequest: - """The 'workspace/configuration' request is sent from the server to the client to fetch a certain - configuration setting. - - This pull model replaces the old push model were the client signaled configuration change via an - event. If the server still needs to react to configuration changes (since the server caches the - result of `workspace/configuration` requests) the server should register for an empty configuration - change event and empty the cache if such an event is received.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: WorkspaceConfigurationParams = attrs.field() - method: str = "workspace/configuration" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceConfigurationResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Sequence[LSPAny] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentColorRequest: - """A request to list all color symbols found in a given text document. The request's - parameter is of type {@link DocumentColorParams} the - response is of type {@link ColorInformation ColorInformation[]} or a Thenable - that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentColorParams = attrs.field() - method: str = "textDocument/documentColor" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentColorResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Sequence[ColorInformation] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentColorPresentationRequest: - """A request to list all presentation for a color. The request's - parameter is of type {@link ColorPresentationParams} the - response is of type {@link ColorInformation ColorInformation[]} or a Thenable - that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: ColorPresentationParams = attrs.field() - method: str = "textDocument/colorPresentation" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentColorPresentationResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Sequence[ColorPresentation] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentFoldingRangeRequest: - """A request to provide folding ranges in a document. The request's - parameter is of type {@link FoldingRangeParams}, the - response is of type {@link FoldingRangeList} or a Thenable - that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: FoldingRangeParams = attrs.field() - method: str = "textDocument/foldingRange" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentFoldingRangeResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[FoldingRange], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceFoldingRangeRefreshRequest: - """@since 3.18.0 - @proposed""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "workspace/foldingRange/refresh" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceFoldingRangeRefreshResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDeclarationRequest: - """A request to resolve the type definition locations of a symbol at a given text - document position. The request's parameter is of type {@link TextDocumentPositionParams} - the response is of type {@link Declaration} or a typed array of {@link DeclarationLink} - or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DeclarationParams = attrs.field() - method: str = "textDocument/declaration" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDeclarationResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Declaration, Sequence[DeclarationLink], None] = attrs.field( - default=None - ) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSelectionRangeRequest: - """A request to provide selection ranges in a document. The request's - parameter is of type {@link SelectionRangeParams}, the - response is of type {@link SelectionRange SelectionRange[]} or a Thenable - that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: SelectionRangeParams = attrs.field() - method: str = "textDocument/selectionRange" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSelectionRangeResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[SelectionRange], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowWorkDoneProgressCreateRequest: - """The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress - reporting from the server.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: WorkDoneProgressCreateParams = attrs.field() - method: str = "window/workDoneProgress/create" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowWorkDoneProgressCreateResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentPrepareCallHierarchyRequest: - """A request to result a `CallHierarchyItem` in a document at a given position. - Can be used as an input to an incoming or outgoing call hierarchy. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CallHierarchyPrepareParams = attrs.field() - method: str = "textDocument/prepareCallHierarchy" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentPrepareCallHierarchyResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[CallHierarchyItem], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CallHierarchyIncomingCallsRequest: - """A request to resolve the incoming calls for a given `CallHierarchyItem`. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CallHierarchyIncomingCallsParams = attrs.field() - method: str = "callHierarchy/incomingCalls" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CallHierarchyIncomingCallsResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[CallHierarchyIncomingCall], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CallHierarchyOutgoingCallsRequest: - """A request to resolve the outgoing calls for a given `CallHierarchyItem`. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CallHierarchyOutgoingCallsParams = attrs.field() - method: str = "callHierarchy/outgoingCalls" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CallHierarchyOutgoingCallsResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[CallHierarchyOutgoingCall], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSemanticTokensFullRequest: - """@since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: SemanticTokensParams = attrs.field() - method: str = "textDocument/semanticTokens/full" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSemanticTokensFullResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[SemanticTokens, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSemanticTokensFullDeltaRequest: - """@since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: SemanticTokensDeltaParams = attrs.field() - method: str = "textDocument/semanticTokens/full/delta" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSemanticTokensFullDeltaResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[SemanticTokens, SemanticTokensDelta, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSemanticTokensRangeRequest: - """@since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: SemanticTokensRangeParams = attrs.field() - method: str = "textDocument/semanticTokens/range" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSemanticTokensRangeResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[SemanticTokens, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceSemanticTokensRefreshRequest: - """@since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "workspace/semanticTokens/refresh" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceSemanticTokensRefreshResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowShowDocumentRequest: - """A request to show a document. This request might open an - external program depending on the value of the URI to open. - For example a request to open `https://code.visualstudio.com/` - will very likely open the URI in a WEB browser. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: ShowDocumentParams = attrs.field() - method: str = "window/showDocument" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowShowDocumentResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: ShowDocumentResult = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentLinkedEditingRangeRequest: - """A request to provide ranges that can be edited together. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: LinkedEditingRangeParams = attrs.field() - method: str = "textDocument/linkedEditingRange" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentLinkedEditingRangeResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[LinkedEditingRanges, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWillCreateFilesRequest: - """The will create files request is sent from the client to the server before files are actually - created as long as the creation is triggered from within the client. - - The request can return a `WorkspaceEdit` which will be applied to workspace before the - files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file - to be created. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CreateFilesParams = attrs.field() - method: str = "workspace/willCreateFiles" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWillCreateFilesResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[WorkspaceEdit, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWillRenameFilesRequest: - """The will rename files request is sent from the client to the server before files are actually - renamed as long as the rename is triggered from within the client. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: RenameFilesParams = attrs.field() - method: str = "workspace/willRenameFiles" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWillRenameFilesResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[WorkspaceEdit, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWillDeleteFilesRequest: - """The did delete files notification is sent from the client to the server when - files were deleted from within the client. - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DeleteFilesParams = attrs.field() - method: str = "workspace/willDeleteFiles" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceWillDeleteFilesResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[WorkspaceEdit, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentMonikerRequest: - """A request to get the moniker of a symbol at a given text document position. - The request parameter is of type {@link TextDocumentPositionParams}. - The response is of type {@link Moniker Moniker[]} or `null`.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: MonikerParams = attrs.field() - method: str = "textDocument/moniker" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentMonikerResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[Moniker], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentPrepareTypeHierarchyRequest: - """A request to result a `TypeHierarchyItem` in a document at a given position. - Can be used as an input to a subtypes or supertypes type hierarchy. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: TypeHierarchyPrepareParams = attrs.field() - method: str = "textDocument/prepareTypeHierarchy" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentPrepareTypeHierarchyResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TypeHierarchyItem], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TypeHierarchySupertypesRequest: - """A request to resolve the supertypes for a given `TypeHierarchyItem`. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: TypeHierarchySupertypesParams = attrs.field() - method: str = "typeHierarchy/supertypes" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TypeHierarchySupertypesResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TypeHierarchyItem], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TypeHierarchySubtypesRequest: - """A request to resolve the subtypes for a given `TypeHierarchyItem`. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: TypeHierarchySubtypesParams = attrs.field() - method: str = "typeHierarchy/subtypes" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TypeHierarchySubtypesResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TypeHierarchyItem], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentInlineValueRequest: - """A request to provide inline values in a document. The request's parameter is of - type {@link InlineValueParams}, the response is of type - {@link InlineValue InlineValue[]} or a Thenable that resolves to such. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: InlineValueParams = attrs.field() - method: str = "textDocument/inlineValue" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentInlineValueResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[InlineValue], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceInlineValueRefreshRequest: - """@since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "workspace/inlineValue/refresh" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceInlineValueRefreshResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentInlayHintRequest: - """A request to provide inlay hints in a document. The request's parameter is of - type {@link InlayHintsParams}, the response is of type - {@link InlayHint InlayHint[]} or a Thenable that resolves to such. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: InlayHintParams = attrs.field() - method: str = "textDocument/inlayHint" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentInlayHintResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[InlayHint], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class InlayHintResolveRequest: - """A request to resolve additional properties for an inlay hint. - The request's parameter is of type {@link InlayHint}, the response is - of type {@link InlayHint} or a Thenable that resolves to such. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: InlayHint = attrs.field() - method: str = "inlayHint/resolve" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class InlayHintResolveResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: InlayHint = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceInlayHintRefreshRequest: - """@since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "workspace/inlayHint/refresh" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceInlayHintRefreshResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDiagnosticRequest: - """The document diagnostic request definition. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentDiagnosticParams = attrs.field() - method: str = "textDocument/diagnostic" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDiagnosticResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: DocumentDiagnosticReport = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDiagnosticRequest: - """The workspace diagnostic request definition. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: WorkspaceDiagnosticParams = attrs.field() - method: str = "workspace/diagnostic" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDiagnosticResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: WorkspaceDiagnosticReport = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDiagnosticRefreshRequest: - """The diagnostic refresh request definition. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "workspace/diagnostic/refresh" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDiagnosticRefreshResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentInlineCompletionRequest: - """A request to provide inline completions in a document. The request's parameter is of - type {@link InlineCompletionParams}, the response is of type - {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such. - - @since 3.18.0 - @proposed""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: InlineCompletionParams = attrs.field() - method: str = "textDocument/inlineCompletion" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentInlineCompletionResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[ - InlineCompletionList, Sequence[InlineCompletionItem], None - ] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ClientRegisterCapabilityRequest: - """The `client/registerCapability` request is sent from the server to the client to register a new capability - handler on the client side.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: RegistrationParams = attrs.field() - method: str = "client/registerCapability" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ClientRegisterCapabilityResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ClientUnregisterCapabilityRequest: - """The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability - handler on the client side.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: UnregistrationParams = attrs.field() - method: str = "client/unregisterCapability" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ClientUnregisterCapabilityResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class InitializeRequest: - """The initialize request is sent from the client to the server. - It is sent once as the request after starting up the server. - The requests parameter is of type {@link InitializeParams} - the response if of type {@link InitializeResult} of a Thenable that - resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: InitializeParams = attrs.field() - method: str = "initialize" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class InitializeResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: InitializeResult = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ShutdownRequest: - """A shutdown request is sent from the client to the server. - It is sent once when the client decides to shutdown the - server. The only notification that is sent after a shutdown request - is the exit event.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "shutdown" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ShutdownResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowShowMessageRequestRequest: - """The show message request is sent from the server to the client to show a message - and a set of options actions to the user.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: ShowMessageRequestParams = attrs.field() - method: str = "window/showMessageRequest" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowShowMessageRequestResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[MessageActionItem, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentWillSaveWaitUntilRequest: - """A document will save request is sent from the client to the server before - the document is actually saved. The request can return an array of TextEdits - which will be applied to the text document before it is saved. Please note that - clients might drop results if computing the text edits took too long or if a - server constantly fails on this request. This is done to keep the save fast and - reliable.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: WillSaveTextDocumentParams = attrs.field() - method: str = "textDocument/willSaveWaitUntil" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentWillSaveWaitUntilResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TextEdit], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentCompletionRequest: - """Request to request completion at a given text document position. The request's - parameter is of type {@link TextDocumentPosition} the response - is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList} - or a Thenable that resolves to such. - - The request can delay the computation of the {@link CompletionItem.detail `detail`} - and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve` - request. However, properties that are needed for the initial sorting and filtering, like `sortText`, - `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CompletionParams = attrs.field() - method: str = "textDocument/completion" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentCompletionResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[CompletionItem], CompletionList, None] = attrs.field( - default=None - ) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CompletionItemResolveRequest: - """Request to resolve additional information for a given completion item.The request's - parameter is of type {@link CompletionItem} the response - is of type {@link CompletionItem} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CompletionItem = attrs.field() - method: str = "completionItem/resolve" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CompletionItemResolveResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: CompletionItem = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentHoverRequest: - """Request to request hover information at a given text document position. The request's - parameter is of type {@link TextDocumentPosition} the response is of - type {@link Hover} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: HoverParams = attrs.field() - method: str = "textDocument/hover" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentHoverResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Hover, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSignatureHelpRequest: - id: Union[int, str] = attrs.field() - """The request id.""" - params: SignatureHelpParams = attrs.field() - method: str = "textDocument/signatureHelp" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentSignatureHelpResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[SignatureHelp, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDefinitionRequest: - """A request to resolve the definition location of a symbol at a given text - document position. The request's parameter is of type {@link TextDocumentPosition} - the response is of either type {@link Definition} or a typed array of - {@link DefinitionLink} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DefinitionParams = attrs.field() - method: str = "textDocument/definition" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDefinitionResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Definition, Sequence[DefinitionLink], None] = attrs.field( - default=None - ) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentReferencesRequest: - """A request to resolve project-wide references for the symbol denoted - by the given text document position. The request's parameter is of - type {@link ReferenceParams} the response is of type - {@link Location Location[]} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: ReferenceParams = attrs.field() - method: str = "textDocument/references" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentReferencesResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[Location], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentHighlightRequest: - """Request to resolve a {@link DocumentHighlight} for a given - text document position. The request's parameter is of type {@link TextDocumentPosition} - the request response is an array of type {@link DocumentHighlight} - or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentHighlightParams = attrs.field() - method: str = "textDocument/documentHighlight" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentHighlightResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[DocumentHighlight], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentSymbolRequest: - """A request to list all symbols found in a given text document. The request's - parameter is of type {@link TextDocumentIdentifier} the - response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable - that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentSymbolParams = attrs.field() - method: str = "textDocument/documentSymbol" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentSymbolResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[ - Sequence[SymbolInformation], Sequence[DocumentSymbol], None - ] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentCodeActionRequest: - """A request to provide commands for the given text document and range.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CodeActionParams = attrs.field() - method: str = "textDocument/codeAction" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentCodeActionResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[Union[Command, CodeAction]], None] = attrs.field( - default=None - ) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CodeActionResolveRequest: - """Request to resolve additional information for a given code action.The request's - parameter is of type {@link CodeAction} the response - is of type {@link CodeAction} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CodeAction = attrs.field() - method: str = "codeAction/resolve" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CodeActionResolveResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: CodeAction = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceSymbolRequest: - """A request to list project-wide symbols matching the query string given - by the {@link WorkspaceSymbolParams}. The response is - of type {@link SymbolInformation SymbolInformation[]} or a Thenable that - resolves to such. - - @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients - need to advertise support for WorkspaceSymbols via the client capability - `workspace.symbol.resolveSupport`.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: WorkspaceSymbolParams = attrs.field() - method: str = "workspace/symbol" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceSymbolResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[ - Sequence[SymbolInformation], Sequence[WorkspaceSymbol], None - ] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceSymbolResolveRequest: - """A request to resolve the range inside the workspace - symbol's location. - - @since 3.17.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: WorkspaceSymbol = attrs.field() - method: str = "workspaceSymbol/resolve" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceSymbolResolveResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: WorkspaceSymbol = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentCodeLensRequest: - """A request to provide code lens for the given text document.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CodeLensParams = attrs.field() - method: str = "textDocument/codeLens" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentCodeLensResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[CodeLens], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CodeLensResolveRequest: - """A request to resolve a command for a given code lens.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: CodeLens = attrs.field() - method: str = "codeLens/resolve" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CodeLensResolveResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: CodeLens = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceCodeLensRefreshRequest: - """A request to refresh all code actions - - @since 3.16.0""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: Optional[None] = attrs.field(default=None) - method: str = "workspace/codeLens/refresh" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceCodeLensRefreshResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: None = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentLinkRequest: - """A request to provide document links""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentLinkParams = attrs.field() - method: str = "textDocument/documentLink" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDocumentLinkResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[DocumentLink], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class DocumentLinkResolveRequest: - """Request to resolve additional information for a given document link. The request's - parameter is of type {@link DocumentLink} the response - is of type {@link DocumentLink} or a Thenable that resolves to such.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentLink = attrs.field() - method: str = "documentLink/resolve" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class DocumentLinkResolveResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: DocumentLink = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentFormattingRequest: - """A request to format a whole document.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentFormattingParams = attrs.field() - method: str = "textDocument/formatting" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentFormattingResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TextEdit], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentRangeFormattingRequest: - """A request to format a range in a document.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentRangeFormattingParams = attrs.field() - method: str = "textDocument/rangeFormatting" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentRangeFormattingResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TextEdit], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentRangesFormattingRequest: - """A request to format ranges in a document. - - @since 3.18.0 - @proposed""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentRangesFormattingParams = attrs.field() - method: str = "textDocument/rangesFormatting" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentRangesFormattingResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TextEdit], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentOnTypeFormattingRequest: - """A request to format a document on type.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: DocumentOnTypeFormattingParams = attrs.field() - method: str = "textDocument/onTypeFormatting" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentOnTypeFormattingResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[Sequence[TextEdit], None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentRenameRequest: - """A request to rename a symbol.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: RenameParams = attrs.field() - method: str = "textDocument/rename" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentRenameResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[WorkspaceEdit, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentPrepareRenameRequest: - """A request to test and perform the setup necessary for a rename. - - @since 3.16 - support for default behavior""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: PrepareRenameParams = attrs.field() - method: str = "textDocument/prepareRename" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentPrepareRenameResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[PrepareRenameResult, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceExecuteCommandRequest: - """A request send from the client to the server to execute a command. The request might return - a workspace edit which the client will apply to the workspace.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: ExecuteCommandParams = attrs.field() - method: str = "workspace/executeCommand" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceExecuteCommandResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: Union[LSPAny, None] = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceApplyEditRequest: - """A request sent from the server to the client to modified certain resources.""" - - id: Union[int, str] = attrs.field() - """The request id.""" - params: ApplyWorkspaceEditParams = attrs.field() - method: str = "workspace/applyEdit" - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceApplyEditResponse: - id: Optional[Union[int, str]] = attrs.field() - """The request id.""" - result: ApplyWorkspaceEditResult = attrs.field(default=None) - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDidChangeWorkspaceFoldersNotification: - """The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace - folder configuration changes.""" - - params: DidChangeWorkspaceFoldersParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["workspace/didChangeWorkspaceFolders"]), - default="workspace/didChangeWorkspaceFolders", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowWorkDoneProgressCancelNotification: - """The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress - initiated on the server side.""" - - params: WorkDoneProgressCancelParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["window/workDoneProgress/cancel"]), - default="window/workDoneProgress/cancel", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDidCreateFilesNotification: - """The did create files notification is sent from the client to the server when - files were created from within the client. - - @since 3.16.0""" - - params: CreateFilesParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["workspace/didCreateFiles"]), - default="workspace/didCreateFiles", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDidRenameFilesNotification: - """The did rename files notification is sent from the client to the server when - files were renamed from within the client. - - @since 3.16.0""" - - params: RenameFilesParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["workspace/didRenameFiles"]), - default="workspace/didRenameFiles", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDidDeleteFilesNotification: - """The will delete files request is sent from the client to the server before files are actually - deleted as long as the deletion is triggered from within the client. - - @since 3.16.0""" - - params: DeleteFilesParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["workspace/didDeleteFiles"]), - default="workspace/didDeleteFiles", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class NotebookDocumentDidOpenNotification: - """A notification sent when a notebook opens. - - @since 3.17.0""" - - params: DidOpenNotebookDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["notebookDocument/didOpen"]), - default="notebookDocument/didOpen", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class NotebookDocumentDidChangeNotification: - params: DidChangeNotebookDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["notebookDocument/didChange"]), - default="notebookDocument/didChange", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class NotebookDocumentDidSaveNotification: - """A notification sent when a notebook document is saved. - - @since 3.17.0""" - - params: DidSaveNotebookDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["notebookDocument/didSave"]), - default="notebookDocument/didSave", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class NotebookDocumentDidCloseNotification: - """A notification sent when a notebook closes. - - @since 3.17.0""" - - params: DidCloseNotebookDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["notebookDocument/didClose"]), - default="notebookDocument/didClose", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class InitializedNotification: - """The initialized notification is sent from the client to the - server after the client is fully initialized and the server - is allowed to send requests from the server to the client.""" - - params: InitializedParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["initialized"]), - default="initialized", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ExitNotification: - """The exit event is sent from the client to the server to - ask the server to exit its process.""" - - params: Optional[None] = attrs.field(default=None) - method: str = attrs.field( - validator=attrs.validators.in_(["exit"]), - default="exit", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDidChangeConfigurationNotification: - """The configuration change notification is sent from the client to the server - when the client's configuration has changed. The notification contains - the changed configuration as defined by the language client.""" - - params: DidChangeConfigurationParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["workspace/didChangeConfiguration"]), - default="workspace/didChangeConfiguration", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowShowMessageNotification: - """The show message notification is sent from a server to a client to ask - the client to display a particular message in the user interface.""" - - params: ShowMessageParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["window/showMessage"]), - default="window/showMessage", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WindowLogMessageNotification: - """The log message notification is sent from the server to the client to ask - the client to log a particular message.""" - - params: LogMessageParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["window/logMessage"]), - default="window/logMessage", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TelemetryEventNotification: - """The telemetry event notification is sent from the server to the client to ask - the client to log telemetry data.""" - - params: LSPAny = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["telemetry/event"]), - default="telemetry/event", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDidOpenNotification: - """The document open notification is sent from the client to the server to signal - newly opened text documents. The document's truth is now managed by the client - and the server must not try to read the document's truth using the document's - uri. Open in this sense means it is managed by the client. It doesn't necessarily - mean that its content is presented in an editor. An open notification must not - be sent more than once without a corresponding close notification send before. - This means open and close notification must be balanced and the max open count - is one.""" - - params: DidOpenTextDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["textDocument/didOpen"]), - default="textDocument/didOpen", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDidChangeNotification: - """The document change notification is sent from the client to the server to signal - changes to a text document.""" - - params: DidChangeTextDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["textDocument/didChange"]), - default="textDocument/didChange", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDidCloseNotification: - """The document close notification is sent from the client to the server when - the document got closed in the client. The document's truth now exists where - the document's uri points to (e.g. if the document's uri is a file uri the - truth now exists on disk). As with the open notification the close notification - is about managing the document's content. Receiving a close notification - doesn't mean that the document was open in an editor before. A close - notification requires a previous open notification to be sent.""" - - params: DidCloseTextDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["textDocument/didClose"]), - default="textDocument/didClose", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentDidSaveNotification: - """The document save notification is sent from the client to the server when - the document got saved in the client.""" - - params: DidSaveTextDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["textDocument/didSave"]), - default="textDocument/didSave", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentWillSaveNotification: - """A document will save notification is sent from the client to the server before - the document is actually saved.""" - - params: WillSaveTextDocumentParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["textDocument/willSave"]), - default="textDocument/willSave", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class WorkspaceDidChangeWatchedFilesNotification: - """The watched files notification is sent from the client to the server when - the client detects changes to file watched by the language client.""" - - params: DidChangeWatchedFilesParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["workspace/didChangeWatchedFiles"]), - default="workspace/didChangeWatchedFiles", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class TextDocumentPublishDiagnosticsNotification: - """Diagnostics notification are sent from the server to the client to signal - results of validation runs.""" - - params: PublishDiagnosticsParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["textDocument/publishDiagnostics"]), - default="textDocument/publishDiagnostics", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class SetTraceNotification: - params: SetTraceParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["$/setTrace"]), - default="$/setTrace", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class LogTraceNotification: - params: LogTraceParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["$/logTrace"]), - default="$/logTrace", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class CancelRequestNotification: - params: CancelParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["$/cancelRequest"]), - default="$/cancelRequest", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@attrs.define -class ProgressNotification: - params: ProgressParams = attrs.field() - method: str = attrs.field( - validator=attrs.validators.in_(["$/progress"]), - default="$/progress", - ) - """The method to be invoked.""" - jsonrpc: str = attrs.field(default="2.0") - - -@enum.unique -class MessageDirection(enum.Enum): - Both = "both" - ClientToServer = "clientToServer" - ServerToClient = "serverToClient" - - -CALL_HIERARCHY_INCOMING_CALLS = "callHierarchy/incomingCalls" -CALL_HIERARCHY_OUTGOING_CALLS = "callHierarchy/outgoingCalls" -CANCEL_REQUEST = "$/cancelRequest" -CLIENT_REGISTER_CAPABILITY = "client/registerCapability" -CLIENT_UNREGISTER_CAPABILITY = "client/unregisterCapability" -CODE_ACTION_RESOLVE = "codeAction/resolve" -CODE_LENS_RESOLVE = "codeLens/resolve" -COMPLETION_ITEM_RESOLVE = "completionItem/resolve" -DOCUMENT_LINK_RESOLVE = "documentLink/resolve" -EXIT = "exit" -INITIALIZE = "initialize" -INITIALIZED = "initialized" -INLAY_HINT_RESOLVE = "inlayHint/resolve" -LOG_TRACE = "$/logTrace" -NOTEBOOK_DOCUMENT_DID_CHANGE = "notebookDocument/didChange" -NOTEBOOK_DOCUMENT_DID_CLOSE = "notebookDocument/didClose" -NOTEBOOK_DOCUMENT_DID_OPEN = "notebookDocument/didOpen" -NOTEBOOK_DOCUMENT_DID_SAVE = "notebookDocument/didSave" -PROGRESS = "$/progress" -SET_TRACE = "$/setTrace" -SHUTDOWN = "shutdown" -TELEMETRY_EVENT = "telemetry/event" -TEXT_DOCUMENT_CODE_ACTION = "textDocument/codeAction" -TEXT_DOCUMENT_CODE_LENS = "textDocument/codeLens" -TEXT_DOCUMENT_COLOR_PRESENTATION = "textDocument/colorPresentation" -TEXT_DOCUMENT_COMPLETION = "textDocument/completion" -TEXT_DOCUMENT_DECLARATION = "textDocument/declaration" -TEXT_DOCUMENT_DEFINITION = "textDocument/definition" -TEXT_DOCUMENT_DIAGNOSTIC = "textDocument/diagnostic" -TEXT_DOCUMENT_DID_CHANGE = "textDocument/didChange" -TEXT_DOCUMENT_DID_CLOSE = "textDocument/didClose" -TEXT_DOCUMENT_DID_OPEN = "textDocument/didOpen" -TEXT_DOCUMENT_DID_SAVE = "textDocument/didSave" -TEXT_DOCUMENT_DOCUMENT_COLOR = "textDocument/documentColor" -TEXT_DOCUMENT_DOCUMENT_HIGHLIGHT = "textDocument/documentHighlight" -TEXT_DOCUMENT_DOCUMENT_LINK = "textDocument/documentLink" -TEXT_DOCUMENT_DOCUMENT_SYMBOL = "textDocument/documentSymbol" -TEXT_DOCUMENT_FOLDING_RANGE = "textDocument/foldingRange" -TEXT_DOCUMENT_FORMATTING = "textDocument/formatting" -TEXT_DOCUMENT_HOVER = "textDocument/hover" -TEXT_DOCUMENT_IMPLEMENTATION = "textDocument/implementation" -TEXT_DOCUMENT_INLAY_HINT = "textDocument/inlayHint" -TEXT_DOCUMENT_INLINE_COMPLETION = "textDocument/inlineCompletion" -TEXT_DOCUMENT_INLINE_VALUE = "textDocument/inlineValue" -TEXT_DOCUMENT_LINKED_EDITING_RANGE = "textDocument/linkedEditingRange" -TEXT_DOCUMENT_MONIKER = "textDocument/moniker" -TEXT_DOCUMENT_ON_TYPE_FORMATTING = "textDocument/onTypeFormatting" -TEXT_DOCUMENT_PREPARE_CALL_HIERARCHY = "textDocument/prepareCallHierarchy" -TEXT_DOCUMENT_PREPARE_RENAME = "textDocument/prepareRename" -TEXT_DOCUMENT_PREPARE_TYPE_HIERARCHY = "textDocument/prepareTypeHierarchy" -TEXT_DOCUMENT_PUBLISH_DIAGNOSTICS = "textDocument/publishDiagnostics" -TEXT_DOCUMENT_RANGES_FORMATTING = "textDocument/rangesFormatting" -TEXT_DOCUMENT_RANGE_FORMATTING = "textDocument/rangeFormatting" -TEXT_DOCUMENT_REFERENCES = "textDocument/references" -TEXT_DOCUMENT_RENAME = "textDocument/rename" -TEXT_DOCUMENT_SELECTION_RANGE = "textDocument/selectionRange" -TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL = "textDocument/semanticTokens/full" -TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL_DELTA = "textDocument/semanticTokens/full/delta" -TEXT_DOCUMENT_SEMANTIC_TOKENS_RANGE = "textDocument/semanticTokens/range" -TEXT_DOCUMENT_SIGNATURE_HELP = "textDocument/signatureHelp" -TEXT_DOCUMENT_TYPE_DEFINITION = "textDocument/typeDefinition" -TEXT_DOCUMENT_WILL_SAVE = "textDocument/willSave" -TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL = "textDocument/willSaveWaitUntil" -TYPE_HIERARCHY_SUBTYPES = "typeHierarchy/subtypes" -TYPE_HIERARCHY_SUPERTYPES = "typeHierarchy/supertypes" -WINDOW_LOG_MESSAGE = "window/logMessage" -WINDOW_SHOW_DOCUMENT = "window/showDocument" -WINDOW_SHOW_MESSAGE = "window/showMessage" -WINDOW_SHOW_MESSAGE_REQUEST = "window/showMessageRequest" -WINDOW_WORK_DONE_PROGRESS_CANCEL = "window/workDoneProgress/cancel" -WINDOW_WORK_DONE_PROGRESS_CREATE = "window/workDoneProgress/create" -WORKSPACE_APPLY_EDIT = "workspace/applyEdit" -WORKSPACE_CODE_LENS_REFRESH = "workspace/codeLens/refresh" -WORKSPACE_CONFIGURATION = "workspace/configuration" -WORKSPACE_DIAGNOSTIC = "workspace/diagnostic" -WORKSPACE_DIAGNOSTIC_REFRESH = "workspace/diagnostic/refresh" -WORKSPACE_DID_CHANGE_CONFIGURATION = "workspace/didChangeConfiguration" -WORKSPACE_DID_CHANGE_WATCHED_FILES = "workspace/didChangeWatchedFiles" -WORKSPACE_DID_CHANGE_WORKSPACE_FOLDERS = "workspace/didChangeWorkspaceFolders" -WORKSPACE_DID_CREATE_FILES = "workspace/didCreateFiles" -WORKSPACE_DID_DELETE_FILES = "workspace/didDeleteFiles" -WORKSPACE_DID_RENAME_FILES = "workspace/didRenameFiles" -WORKSPACE_EXECUTE_COMMAND = "workspace/executeCommand" -WORKSPACE_FOLDING_RANGE_REFRESH = "workspace/foldingRange/refresh" -WORKSPACE_INLAY_HINT_REFRESH = "workspace/inlayHint/refresh" -WORKSPACE_INLINE_VALUE_REFRESH = "workspace/inlineValue/refresh" -WORKSPACE_SEMANTIC_TOKENS_REFRESH = "workspace/semanticTokens/refresh" -WORKSPACE_SYMBOL = "workspace/symbol" -WORKSPACE_SYMBOL_RESOLVE = "workspaceSymbol/resolve" -WORKSPACE_WILL_CREATE_FILES = "workspace/willCreateFiles" -WORKSPACE_WILL_DELETE_FILES = "workspace/willDeleteFiles" -WORKSPACE_WILL_RENAME_FILES = "workspace/willRenameFiles" -WORKSPACE_WORKSPACE_FOLDERS = "workspace/workspaceFolders" - -METHOD_TO_TYPES = { - # Requests - CALL_HIERARCHY_INCOMING_CALLS: ( - CallHierarchyIncomingCallsRequest, - CallHierarchyIncomingCallsResponse, - CallHierarchyIncomingCallsParams, - None, - ), - CALL_HIERARCHY_OUTGOING_CALLS: ( - CallHierarchyOutgoingCallsRequest, - CallHierarchyOutgoingCallsResponse, - CallHierarchyOutgoingCallsParams, - None, - ), - CLIENT_REGISTER_CAPABILITY: ( - ClientRegisterCapabilityRequest, - ClientRegisterCapabilityResponse, - RegistrationParams, - None, - ), - CLIENT_UNREGISTER_CAPABILITY: ( - ClientUnregisterCapabilityRequest, - ClientUnregisterCapabilityResponse, - UnregistrationParams, - None, - ), - CODE_ACTION_RESOLVE: ( - CodeActionResolveRequest, - CodeActionResolveResponse, - CodeAction, - None, - ), - CODE_LENS_RESOLVE: ( - CodeLensResolveRequest, - CodeLensResolveResponse, - CodeLens, - None, - ), - COMPLETION_ITEM_RESOLVE: ( - CompletionItemResolveRequest, - CompletionItemResolveResponse, - CompletionItem, - None, - ), - DOCUMENT_LINK_RESOLVE: ( - DocumentLinkResolveRequest, - DocumentLinkResolveResponse, - DocumentLink, - None, - ), - INITIALIZE: (InitializeRequest, InitializeResponse, InitializeParams, None), - INLAY_HINT_RESOLVE: ( - InlayHintResolveRequest, - InlayHintResolveResponse, - InlayHint, - None, - ), - SHUTDOWN: (ShutdownRequest, ShutdownResponse, None, None), - TEXT_DOCUMENT_CODE_ACTION: ( - TextDocumentCodeActionRequest, - TextDocumentCodeActionResponse, - CodeActionParams, - CodeActionRegistrationOptions, - ), - TEXT_DOCUMENT_CODE_LENS: ( - TextDocumentCodeLensRequest, - TextDocumentCodeLensResponse, - CodeLensParams, - CodeLensRegistrationOptions, - ), - TEXT_DOCUMENT_COLOR_PRESENTATION: ( - TextDocumentColorPresentationRequest, - TextDocumentColorPresentationResponse, - ColorPresentationParams, - TextDocumentColorPresentationOptions, - ), - TEXT_DOCUMENT_COMPLETION: ( - TextDocumentCompletionRequest, - TextDocumentCompletionResponse, - CompletionParams, - CompletionRegistrationOptions, - ), - TEXT_DOCUMENT_DECLARATION: ( - TextDocumentDeclarationRequest, - TextDocumentDeclarationResponse, - DeclarationParams, - DeclarationRegistrationOptions, - ), - TEXT_DOCUMENT_DEFINITION: ( - TextDocumentDefinitionRequest, - TextDocumentDefinitionResponse, - DefinitionParams, - DefinitionRegistrationOptions, - ), - TEXT_DOCUMENT_DIAGNOSTIC: ( - TextDocumentDiagnosticRequest, - TextDocumentDiagnosticResponse, - DocumentDiagnosticParams, - DiagnosticRegistrationOptions, - ), - TEXT_DOCUMENT_DOCUMENT_COLOR: ( - TextDocumentDocumentColorRequest, - TextDocumentDocumentColorResponse, - DocumentColorParams, - DocumentColorRegistrationOptions, - ), - TEXT_DOCUMENT_DOCUMENT_HIGHLIGHT: ( - TextDocumentDocumentHighlightRequest, - TextDocumentDocumentHighlightResponse, - DocumentHighlightParams, - DocumentHighlightRegistrationOptions, - ), - TEXT_DOCUMENT_DOCUMENT_LINK: ( - TextDocumentDocumentLinkRequest, - TextDocumentDocumentLinkResponse, - DocumentLinkParams, - DocumentLinkRegistrationOptions, - ), - TEXT_DOCUMENT_DOCUMENT_SYMBOL: ( - TextDocumentDocumentSymbolRequest, - TextDocumentDocumentSymbolResponse, - DocumentSymbolParams, - DocumentSymbolRegistrationOptions, - ), - TEXT_DOCUMENT_FOLDING_RANGE: ( - TextDocumentFoldingRangeRequest, - TextDocumentFoldingRangeResponse, - FoldingRangeParams, - FoldingRangeRegistrationOptions, - ), - TEXT_DOCUMENT_FORMATTING: ( - TextDocumentFormattingRequest, - TextDocumentFormattingResponse, - DocumentFormattingParams, - DocumentFormattingRegistrationOptions, - ), - TEXT_DOCUMENT_HOVER: ( - TextDocumentHoverRequest, - TextDocumentHoverResponse, - HoverParams, - HoverRegistrationOptions, - ), - TEXT_DOCUMENT_IMPLEMENTATION: ( - TextDocumentImplementationRequest, - TextDocumentImplementationResponse, - ImplementationParams, - ImplementationRegistrationOptions, - ), - TEXT_DOCUMENT_INLAY_HINT: ( - TextDocumentInlayHintRequest, - TextDocumentInlayHintResponse, - InlayHintParams, - InlayHintRegistrationOptions, - ), - TEXT_DOCUMENT_INLINE_COMPLETION: ( - TextDocumentInlineCompletionRequest, - TextDocumentInlineCompletionResponse, - InlineCompletionParams, - InlineCompletionRegistrationOptions, - ), - TEXT_DOCUMENT_INLINE_VALUE: ( - TextDocumentInlineValueRequest, - TextDocumentInlineValueResponse, - InlineValueParams, - InlineValueRegistrationOptions, - ), - TEXT_DOCUMENT_LINKED_EDITING_RANGE: ( - TextDocumentLinkedEditingRangeRequest, - TextDocumentLinkedEditingRangeResponse, - LinkedEditingRangeParams, - LinkedEditingRangeRegistrationOptions, - ), - TEXT_DOCUMENT_MONIKER: ( - TextDocumentMonikerRequest, - TextDocumentMonikerResponse, - MonikerParams, - MonikerRegistrationOptions, - ), - TEXT_DOCUMENT_ON_TYPE_FORMATTING: ( - TextDocumentOnTypeFormattingRequest, - TextDocumentOnTypeFormattingResponse, - DocumentOnTypeFormattingParams, - DocumentOnTypeFormattingRegistrationOptions, - ), - TEXT_DOCUMENT_PREPARE_CALL_HIERARCHY: ( - TextDocumentPrepareCallHierarchyRequest, - TextDocumentPrepareCallHierarchyResponse, - CallHierarchyPrepareParams, - CallHierarchyRegistrationOptions, - ), - TEXT_DOCUMENT_PREPARE_RENAME: ( - TextDocumentPrepareRenameRequest, - TextDocumentPrepareRenameResponse, - PrepareRenameParams, - None, - ), - TEXT_DOCUMENT_PREPARE_TYPE_HIERARCHY: ( - TextDocumentPrepareTypeHierarchyRequest, - TextDocumentPrepareTypeHierarchyResponse, - TypeHierarchyPrepareParams, - TypeHierarchyRegistrationOptions, - ), - TEXT_DOCUMENT_RANGES_FORMATTING: ( - TextDocumentRangesFormattingRequest, - TextDocumentRangesFormattingResponse, - DocumentRangesFormattingParams, - DocumentRangeFormattingRegistrationOptions, - ), - TEXT_DOCUMENT_RANGE_FORMATTING: ( - TextDocumentRangeFormattingRequest, - TextDocumentRangeFormattingResponse, - DocumentRangeFormattingParams, - DocumentRangeFormattingRegistrationOptions, - ), - TEXT_DOCUMENT_REFERENCES: ( - TextDocumentReferencesRequest, - TextDocumentReferencesResponse, - ReferenceParams, - ReferenceRegistrationOptions, - ), - TEXT_DOCUMENT_RENAME: ( - TextDocumentRenameRequest, - TextDocumentRenameResponse, - RenameParams, - RenameRegistrationOptions, - ), - TEXT_DOCUMENT_SELECTION_RANGE: ( - TextDocumentSelectionRangeRequest, - TextDocumentSelectionRangeResponse, - SelectionRangeParams, - SelectionRangeRegistrationOptions, - ), - TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL: ( - TextDocumentSemanticTokensFullRequest, - TextDocumentSemanticTokensFullResponse, - SemanticTokensParams, - SemanticTokensRegistrationOptions, - ), - TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL_DELTA: ( - TextDocumentSemanticTokensFullDeltaRequest, - TextDocumentSemanticTokensFullDeltaResponse, - SemanticTokensDeltaParams, - SemanticTokensRegistrationOptions, - ), - TEXT_DOCUMENT_SEMANTIC_TOKENS_RANGE: ( - TextDocumentSemanticTokensRangeRequest, - TextDocumentSemanticTokensRangeResponse, - SemanticTokensRangeParams, - None, - ), - TEXT_DOCUMENT_SIGNATURE_HELP: ( - TextDocumentSignatureHelpRequest, - TextDocumentSignatureHelpResponse, - SignatureHelpParams, - SignatureHelpRegistrationOptions, - ), - TEXT_DOCUMENT_TYPE_DEFINITION: ( - TextDocumentTypeDefinitionRequest, - TextDocumentTypeDefinitionResponse, - TypeDefinitionParams, - TypeDefinitionRegistrationOptions, - ), - TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL: ( - TextDocumentWillSaveWaitUntilRequest, - TextDocumentWillSaveWaitUntilResponse, - WillSaveTextDocumentParams, - TextDocumentRegistrationOptions, - ), - TYPE_HIERARCHY_SUBTYPES: ( - TypeHierarchySubtypesRequest, - TypeHierarchySubtypesResponse, - TypeHierarchySubtypesParams, - None, - ), - TYPE_HIERARCHY_SUPERTYPES: ( - TypeHierarchySupertypesRequest, - TypeHierarchySupertypesResponse, - TypeHierarchySupertypesParams, - None, - ), - WINDOW_SHOW_DOCUMENT: ( - WindowShowDocumentRequest, - WindowShowDocumentResponse, - ShowDocumentParams, - None, - ), - WINDOW_SHOW_MESSAGE_REQUEST: ( - WindowShowMessageRequestRequest, - WindowShowMessageRequestResponse, - ShowMessageRequestParams, - None, - ), - WINDOW_WORK_DONE_PROGRESS_CREATE: ( - WindowWorkDoneProgressCreateRequest, - WindowWorkDoneProgressCreateResponse, - WorkDoneProgressCreateParams, - None, - ), - WORKSPACE_APPLY_EDIT: ( - WorkspaceApplyEditRequest, - WorkspaceApplyEditResponse, - ApplyWorkspaceEditParams, - None, - ), - WORKSPACE_CODE_LENS_REFRESH: ( - WorkspaceCodeLensRefreshRequest, - WorkspaceCodeLensRefreshResponse, - None, - None, - ), - WORKSPACE_CONFIGURATION: ( - WorkspaceConfigurationRequest, - WorkspaceConfigurationResponse, - ConfigurationParams, - None, - ), - WORKSPACE_DIAGNOSTIC: ( - WorkspaceDiagnosticRequest, - WorkspaceDiagnosticResponse, - WorkspaceDiagnosticParams, - None, - ), - WORKSPACE_DIAGNOSTIC_REFRESH: ( - WorkspaceDiagnosticRefreshRequest, - WorkspaceDiagnosticRefreshResponse, - None, - None, - ), - WORKSPACE_EXECUTE_COMMAND: ( - WorkspaceExecuteCommandRequest, - WorkspaceExecuteCommandResponse, - ExecuteCommandParams, - ExecuteCommandRegistrationOptions, - ), - WORKSPACE_FOLDING_RANGE_REFRESH: ( - WorkspaceFoldingRangeRefreshRequest, - WorkspaceFoldingRangeRefreshResponse, - None, - None, - ), - WORKSPACE_INLAY_HINT_REFRESH: ( - WorkspaceInlayHintRefreshRequest, - WorkspaceInlayHintRefreshResponse, - None, - None, - ), - WORKSPACE_INLINE_VALUE_REFRESH: ( - WorkspaceInlineValueRefreshRequest, - WorkspaceInlineValueRefreshResponse, - None, - None, - ), - WORKSPACE_SEMANTIC_TOKENS_REFRESH: ( - WorkspaceSemanticTokensRefreshRequest, - WorkspaceSemanticTokensRefreshResponse, - None, - None, - ), - WORKSPACE_SYMBOL: ( - WorkspaceSymbolRequest, - WorkspaceSymbolResponse, - WorkspaceSymbolParams, - WorkspaceSymbolRegistrationOptions, - ), - WORKSPACE_SYMBOL_RESOLVE: ( - WorkspaceSymbolResolveRequest, - WorkspaceSymbolResolveResponse, - WorkspaceSymbol, - None, - ), - WORKSPACE_WILL_CREATE_FILES: ( - WorkspaceWillCreateFilesRequest, - WorkspaceWillCreateFilesResponse, - CreateFilesParams, - FileOperationRegistrationOptions, - ), - WORKSPACE_WILL_DELETE_FILES: ( - WorkspaceWillDeleteFilesRequest, - WorkspaceWillDeleteFilesResponse, - DeleteFilesParams, - FileOperationRegistrationOptions, - ), - WORKSPACE_WILL_RENAME_FILES: ( - WorkspaceWillRenameFilesRequest, - WorkspaceWillRenameFilesResponse, - RenameFilesParams, - FileOperationRegistrationOptions, - ), - WORKSPACE_WORKSPACE_FOLDERS: ( - WorkspaceWorkspaceFoldersRequest, - WorkspaceWorkspaceFoldersResponse, - None, - None, - ), - # Notifications - CANCEL_REQUEST: (CancelRequestNotification, None, CancelParams, None), - EXIT: (ExitNotification, None, None, None), - INITIALIZED: (InitializedNotification, None, InitializedParams, None), - LOG_TRACE: (LogTraceNotification, None, LogTraceParams, None), - NOTEBOOK_DOCUMENT_DID_CHANGE: ( - NotebookDocumentDidChangeNotification, - None, - DidChangeNotebookDocumentParams, - None, - ), - NOTEBOOK_DOCUMENT_DID_CLOSE: ( - NotebookDocumentDidCloseNotification, - None, - DidCloseNotebookDocumentParams, - None, - ), - NOTEBOOK_DOCUMENT_DID_OPEN: ( - NotebookDocumentDidOpenNotification, - None, - DidOpenNotebookDocumentParams, - None, - ), - NOTEBOOK_DOCUMENT_DID_SAVE: ( - NotebookDocumentDidSaveNotification, - None, - DidSaveNotebookDocumentParams, - None, - ), - PROGRESS: (ProgressNotification, None, ProgressParams, None), - SET_TRACE: (SetTraceNotification, None, SetTraceParams, None), - TELEMETRY_EVENT: (TelemetryEventNotification, None, LSPAny, None), - TEXT_DOCUMENT_DID_CHANGE: ( - TextDocumentDidChangeNotification, - None, - DidChangeTextDocumentParams, - TextDocumentChangeRegistrationOptions, - ), - TEXT_DOCUMENT_DID_CLOSE: ( - TextDocumentDidCloseNotification, - None, - DidCloseTextDocumentParams, - TextDocumentRegistrationOptions, - ), - TEXT_DOCUMENT_DID_OPEN: ( - TextDocumentDidOpenNotification, - None, - DidOpenTextDocumentParams, - TextDocumentRegistrationOptions, - ), - TEXT_DOCUMENT_DID_SAVE: ( - TextDocumentDidSaveNotification, - None, - DidSaveTextDocumentParams, - TextDocumentSaveRegistrationOptions, - ), - TEXT_DOCUMENT_PUBLISH_DIAGNOSTICS: ( - TextDocumentPublishDiagnosticsNotification, - None, - PublishDiagnosticsParams, - None, - ), - TEXT_DOCUMENT_WILL_SAVE: ( - TextDocumentWillSaveNotification, - None, - WillSaveTextDocumentParams, - TextDocumentRegistrationOptions, - ), - WINDOW_LOG_MESSAGE: (WindowLogMessageNotification, None, LogMessageParams, None), - WINDOW_SHOW_MESSAGE: (WindowShowMessageNotification, None, ShowMessageParams, None), - WINDOW_WORK_DONE_PROGRESS_CANCEL: ( - WindowWorkDoneProgressCancelNotification, - None, - WorkDoneProgressCancelParams, - None, - ), - WORKSPACE_DID_CHANGE_CONFIGURATION: ( - WorkspaceDidChangeConfigurationNotification, - None, - DidChangeConfigurationParams, - DidChangeConfigurationRegistrationOptions, - ), - WORKSPACE_DID_CHANGE_WATCHED_FILES: ( - WorkspaceDidChangeWatchedFilesNotification, - None, - DidChangeWatchedFilesParams, - DidChangeWatchedFilesRegistrationOptions, - ), - WORKSPACE_DID_CHANGE_WORKSPACE_FOLDERS: ( - WorkspaceDidChangeWorkspaceFoldersNotification, - None, - DidChangeWorkspaceFoldersParams, - None, - ), - WORKSPACE_DID_CREATE_FILES: ( - WorkspaceDidCreateFilesNotification, - None, - CreateFilesParams, - FileOperationRegistrationOptions, - ), - WORKSPACE_DID_DELETE_FILES: ( - WorkspaceDidDeleteFilesNotification, - None, - DeleteFilesParams, - FileOperationRegistrationOptions, - ), - WORKSPACE_DID_RENAME_FILES: ( - WorkspaceDidRenameFilesNotification, - None, - RenameFilesParams, - FileOperationRegistrationOptions, - ), -} -REQUESTS = Union[ - CallHierarchyIncomingCallsRequest, - CallHierarchyOutgoingCallsRequest, - ClientRegisterCapabilityRequest, - ClientUnregisterCapabilityRequest, - CodeActionResolveRequest, - CodeLensResolveRequest, - CompletionItemResolveRequest, - DocumentLinkResolveRequest, - InitializeRequest, - InlayHintResolveRequest, - ShutdownRequest, - TextDocumentCodeActionRequest, - TextDocumentCodeLensRequest, - TextDocumentColorPresentationRequest, - TextDocumentCompletionRequest, - TextDocumentDeclarationRequest, - TextDocumentDefinitionRequest, - TextDocumentDiagnosticRequest, - TextDocumentDocumentColorRequest, - TextDocumentDocumentHighlightRequest, - TextDocumentDocumentLinkRequest, - TextDocumentDocumentSymbolRequest, - TextDocumentFoldingRangeRequest, - TextDocumentFormattingRequest, - TextDocumentHoverRequest, - TextDocumentImplementationRequest, - TextDocumentInlayHintRequest, - TextDocumentInlineCompletionRequest, - TextDocumentInlineValueRequest, - TextDocumentLinkedEditingRangeRequest, - TextDocumentMonikerRequest, - TextDocumentOnTypeFormattingRequest, - TextDocumentPrepareCallHierarchyRequest, - TextDocumentPrepareRenameRequest, - TextDocumentPrepareTypeHierarchyRequest, - TextDocumentRangeFormattingRequest, - TextDocumentRangesFormattingRequest, - TextDocumentReferencesRequest, - TextDocumentRenameRequest, - TextDocumentSelectionRangeRequest, - TextDocumentSemanticTokensFullDeltaRequest, - TextDocumentSemanticTokensFullRequest, - TextDocumentSemanticTokensRangeRequest, - TextDocumentSignatureHelpRequest, - TextDocumentTypeDefinitionRequest, - TextDocumentWillSaveWaitUntilRequest, - TypeHierarchySubtypesRequest, - TypeHierarchySupertypesRequest, - WindowShowDocumentRequest, - WindowShowMessageRequestRequest, - WindowWorkDoneProgressCreateRequest, - WorkspaceApplyEditRequest, - WorkspaceCodeLensRefreshRequest, - WorkspaceConfigurationRequest, - WorkspaceDiagnosticRefreshRequest, - WorkspaceDiagnosticRequest, - WorkspaceExecuteCommandRequest, - WorkspaceFoldingRangeRefreshRequest, - WorkspaceInlayHintRefreshRequest, - WorkspaceInlineValueRefreshRequest, - WorkspaceSemanticTokensRefreshRequest, - WorkspaceSymbolRequest, - WorkspaceSymbolResolveRequest, - WorkspaceWillCreateFilesRequest, - WorkspaceWillDeleteFilesRequest, - WorkspaceWillRenameFilesRequest, - WorkspaceWorkspaceFoldersRequest, -] -RESPONSES = Union[ - CallHierarchyIncomingCallsResponse, - CallHierarchyOutgoingCallsResponse, - ClientRegisterCapabilityResponse, - ClientUnregisterCapabilityResponse, - CodeActionResolveResponse, - CodeLensResolveResponse, - CompletionItemResolveResponse, - DocumentLinkResolveResponse, - InitializeResponse, - InlayHintResolveResponse, - ShutdownResponse, - TextDocumentCodeActionResponse, - TextDocumentCodeLensResponse, - TextDocumentColorPresentationResponse, - TextDocumentCompletionResponse, - TextDocumentDeclarationResponse, - TextDocumentDefinitionResponse, - TextDocumentDiagnosticResponse, - TextDocumentDocumentColorResponse, - TextDocumentDocumentHighlightResponse, - TextDocumentDocumentLinkResponse, - TextDocumentDocumentSymbolResponse, - TextDocumentFoldingRangeResponse, - TextDocumentFormattingResponse, - TextDocumentHoverResponse, - TextDocumentImplementationResponse, - TextDocumentInlayHintResponse, - TextDocumentInlineCompletionResponse, - TextDocumentInlineValueResponse, - TextDocumentLinkedEditingRangeResponse, - TextDocumentMonikerResponse, - TextDocumentOnTypeFormattingResponse, - TextDocumentPrepareCallHierarchyResponse, - TextDocumentPrepareRenameResponse, - TextDocumentPrepareTypeHierarchyResponse, - TextDocumentRangeFormattingResponse, - TextDocumentRangesFormattingResponse, - TextDocumentReferencesResponse, - TextDocumentRenameResponse, - TextDocumentSelectionRangeResponse, - TextDocumentSemanticTokensFullDeltaResponse, - TextDocumentSemanticTokensFullResponse, - TextDocumentSemanticTokensRangeResponse, - TextDocumentSignatureHelpResponse, - TextDocumentTypeDefinitionResponse, - TextDocumentWillSaveWaitUntilResponse, - TypeHierarchySubtypesResponse, - TypeHierarchySupertypesResponse, - WindowShowDocumentResponse, - WindowShowMessageRequestResponse, - WindowWorkDoneProgressCreateResponse, - WorkspaceApplyEditResponse, - WorkspaceCodeLensRefreshResponse, - WorkspaceConfigurationResponse, - WorkspaceDiagnosticRefreshResponse, - WorkspaceDiagnosticResponse, - WorkspaceExecuteCommandResponse, - WorkspaceFoldingRangeRefreshResponse, - WorkspaceInlayHintRefreshResponse, - WorkspaceInlineValueRefreshResponse, - WorkspaceSemanticTokensRefreshResponse, - WorkspaceSymbolResolveResponse, - WorkspaceSymbolResponse, - WorkspaceWillCreateFilesResponse, - WorkspaceWillDeleteFilesResponse, - WorkspaceWillRenameFilesResponse, - WorkspaceWorkspaceFoldersResponse, -] -NOTIFICATIONS = Union[ - CancelRequestNotification, - ExitNotification, - InitializedNotification, - LogTraceNotification, - NotebookDocumentDidChangeNotification, - NotebookDocumentDidCloseNotification, - NotebookDocumentDidOpenNotification, - NotebookDocumentDidSaveNotification, - ProgressNotification, - SetTraceNotification, - TelemetryEventNotification, - TextDocumentDidChangeNotification, - TextDocumentDidCloseNotification, - TextDocumentDidOpenNotification, - TextDocumentDidSaveNotification, - TextDocumentPublishDiagnosticsNotification, - TextDocumentWillSaveNotification, - WindowLogMessageNotification, - WindowShowMessageNotification, - WindowWorkDoneProgressCancelNotification, - WorkspaceDidChangeConfigurationNotification, - WorkspaceDidChangeWatchedFilesNotification, - WorkspaceDidChangeWorkspaceFoldersNotification, - WorkspaceDidCreateFilesNotification, - WorkspaceDidDeleteFilesNotification, - WorkspaceDidRenameFilesNotification, -] -MESSAGE_TYPES = Union[REQUESTS, RESPONSES, NOTIFICATIONS, ResponseErrorMessage] - -_KEYWORD_CLASSES = [CallHierarchyIncomingCall] - - -def is_keyword_class(cls: type) -> bool: - """Returns true if the class has a property that may be python keyword.""" - return any(cls is c for c in _KEYWORD_CLASSES) - - -_SPECIAL_CLASSES = [ - CallHierarchyIncomingCallsRequest, - CallHierarchyIncomingCallsResponse, - CallHierarchyOutgoingCallsRequest, - CallHierarchyOutgoingCallsResponse, - CallHierarchyRegistrationOptions, - CancelRequestNotification, - ClientRegisterCapabilityRequest, - ClientRegisterCapabilityResponse, - ClientUnregisterCapabilityRequest, - ClientUnregisterCapabilityResponse, - CodeActionRegistrationOptions, - CodeActionResolveRequest, - CodeActionResolveResponse, - CodeLensRegistrationOptions, - CodeLensResolveRequest, - CodeLensResolveResponse, - CompletionItemResolveRequest, - CompletionItemResolveResponse, - CompletionRegistrationOptions, - CreateFile, - DeclarationRegistrationOptions, - DefinitionRegistrationOptions, - DeleteFile, - DiagnosticRegistrationOptions, - DocumentColorRegistrationOptions, - DocumentFormattingRegistrationOptions, - DocumentHighlightRegistrationOptions, - DocumentLinkRegistrationOptions, - DocumentLinkResolveRequest, - DocumentLinkResolveResponse, - DocumentOnTypeFormattingRegistrationOptions, - DocumentRangeFormattingRegistrationOptions, - DocumentSymbolRegistrationOptions, - ExitNotification, - FoldingRangeRegistrationOptions, - FullDocumentDiagnosticReport, - HoverRegistrationOptions, - ImplementationRegistrationOptions, - InitializeParams, - InitializeRequest, - InitializeResponse, - InitializedNotification, - InlayHintRegistrationOptions, - InlayHintResolveRequest, - InlayHintResolveResponse, - InlineCompletionRegistrationOptions, - InlineValueRegistrationOptions, - LinkedEditingRangeRegistrationOptions, - LogTraceNotification, - MonikerRegistrationOptions, - NotebookDocumentDidChangeNotification, - NotebookDocumentDidCloseNotification, - NotebookDocumentDidOpenNotification, - NotebookDocumentDidSaveNotification, - OptionalVersionedTextDocumentIdentifier, - ProgressNotification, - ReferenceRegistrationOptions, - RelatedFullDocumentDiagnosticReport, - RelatedUnchangedDocumentDiagnosticReport, - RenameFile, - RenameRegistrationOptions, - ResponseErrorMessage, - SelectionRangeRegistrationOptions, - SemanticTokensRegistrationOptions, - SetTraceNotification, - ShutdownRequest, - ShutdownResponse, - SignatureHelpRegistrationOptions, - StringValue, - TelemetryEventNotification, - TextDocumentChangeRegistrationOptions, - TextDocumentCodeActionRequest, - TextDocumentCodeActionResponse, - TextDocumentCodeLensRequest, - TextDocumentCodeLensResponse, - TextDocumentColorPresentationOptions, - TextDocumentColorPresentationRequest, - TextDocumentColorPresentationResponse, - TextDocumentCompletionRequest, - TextDocumentCompletionResponse, - TextDocumentDeclarationRequest, - TextDocumentDeclarationResponse, - TextDocumentDefinitionRequest, - TextDocumentDefinitionResponse, - TextDocumentDiagnosticRequest, - TextDocumentDiagnosticResponse, - TextDocumentDidChangeNotification, - TextDocumentDidCloseNotification, - TextDocumentDidOpenNotification, - TextDocumentDidSaveNotification, - TextDocumentDocumentColorRequest, - TextDocumentDocumentColorResponse, - TextDocumentDocumentHighlightRequest, - TextDocumentDocumentHighlightResponse, - TextDocumentDocumentLinkRequest, - TextDocumentDocumentLinkResponse, - TextDocumentDocumentSymbolRequest, - TextDocumentDocumentSymbolResponse, - TextDocumentFoldingRangeRequest, - TextDocumentFoldingRangeResponse, - TextDocumentFormattingRequest, - TextDocumentFormattingResponse, - TextDocumentHoverRequest, - TextDocumentHoverResponse, - TextDocumentImplementationRequest, - TextDocumentImplementationResponse, - TextDocumentInlayHintRequest, - TextDocumentInlayHintResponse, - TextDocumentInlineCompletionRequest, - TextDocumentInlineCompletionResponse, - TextDocumentInlineValueRequest, - TextDocumentInlineValueResponse, - TextDocumentLinkedEditingRangeRequest, - TextDocumentLinkedEditingRangeResponse, - TextDocumentMonikerRequest, - TextDocumentMonikerResponse, - TextDocumentOnTypeFormattingRequest, - TextDocumentOnTypeFormattingResponse, - TextDocumentPrepareCallHierarchyRequest, - TextDocumentPrepareCallHierarchyResponse, - TextDocumentPrepareRenameRequest, - TextDocumentPrepareRenameResponse, - TextDocumentPrepareTypeHierarchyRequest, - TextDocumentPrepareTypeHierarchyResponse, - TextDocumentPublishDiagnosticsNotification, - TextDocumentRangeFormattingRequest, - TextDocumentRangeFormattingResponse, - TextDocumentRangesFormattingRequest, - TextDocumentRangesFormattingResponse, - TextDocumentReferencesRequest, - TextDocumentReferencesResponse, - TextDocumentRegistrationOptions, - TextDocumentRenameRequest, - TextDocumentRenameResponse, - TextDocumentSaveRegistrationOptions, - TextDocumentSelectionRangeRequest, - TextDocumentSelectionRangeResponse, - TextDocumentSemanticTokensFullDeltaRequest, - TextDocumentSemanticTokensFullDeltaResponse, - TextDocumentSemanticTokensFullRequest, - TextDocumentSemanticTokensFullResponse, - TextDocumentSemanticTokensRangeRequest, - TextDocumentSemanticTokensRangeResponse, - TextDocumentSignatureHelpRequest, - TextDocumentSignatureHelpResponse, - TextDocumentTypeDefinitionRequest, - TextDocumentTypeDefinitionResponse, - TextDocumentWillSaveNotification, - TextDocumentWillSaveWaitUntilRequest, - TextDocumentWillSaveWaitUntilResponse, - TypeDefinitionRegistrationOptions, - TypeHierarchyRegistrationOptions, - TypeHierarchySubtypesRequest, - TypeHierarchySubtypesResponse, - TypeHierarchySupertypesRequest, - TypeHierarchySupertypesResponse, - UnchangedDocumentDiagnosticReport, - WindowLogMessageNotification, - WindowShowDocumentRequest, - WindowShowDocumentResponse, - WindowShowMessageNotification, - WindowShowMessageRequestRequest, - WindowShowMessageRequestResponse, - WindowWorkDoneProgressCancelNotification, - WindowWorkDoneProgressCreateRequest, - WindowWorkDoneProgressCreateResponse, - WorkDoneProgressBegin, - WorkDoneProgressEnd, - WorkDoneProgressReport, - WorkspaceApplyEditRequest, - WorkspaceApplyEditResponse, - WorkspaceCodeLensRefreshRequest, - WorkspaceCodeLensRefreshResponse, - WorkspaceConfigurationRequest, - WorkspaceConfigurationResponse, - WorkspaceDiagnosticRefreshRequest, - WorkspaceDiagnosticRefreshResponse, - WorkspaceDiagnosticRequest, - WorkspaceDiagnosticResponse, - WorkspaceDidChangeConfigurationNotification, - WorkspaceDidChangeWatchedFilesNotification, - WorkspaceDidChangeWorkspaceFoldersNotification, - WorkspaceDidCreateFilesNotification, - WorkspaceDidDeleteFilesNotification, - WorkspaceDidRenameFilesNotification, - WorkspaceExecuteCommandRequest, - WorkspaceExecuteCommandResponse, - WorkspaceFoldersInitializeParams, - WorkspaceFoldingRangeRefreshRequest, - WorkspaceFoldingRangeRefreshResponse, - WorkspaceFullDocumentDiagnosticReport, - WorkspaceInlayHintRefreshRequest, - WorkspaceInlayHintRefreshResponse, - WorkspaceInlineValueRefreshRequest, - WorkspaceInlineValueRefreshResponse, - WorkspaceSemanticTokensRefreshRequest, - WorkspaceSemanticTokensRefreshResponse, - WorkspaceSymbolRequest, - WorkspaceSymbolResolveRequest, - WorkspaceSymbolResolveResponse, - WorkspaceSymbolResponse, - WorkspaceUnchangedDocumentDiagnosticReport, - WorkspaceWillCreateFilesRequest, - WorkspaceWillCreateFilesResponse, - WorkspaceWillDeleteFilesRequest, - WorkspaceWillDeleteFilesResponse, - WorkspaceWillRenameFilesRequest, - WorkspaceWillRenameFilesResponse, - WorkspaceWorkspaceFoldersRequest, - WorkspaceWorkspaceFoldersResponse, - _InitializeParams, -] - - -def is_special_class(cls: type) -> bool: - """Returns true if the class or its properties require special handling.""" - return any(cls is c for c in _SPECIAL_CLASSES) - - -_SPECIAL_PROPERTIES = [ - "CallHierarchyIncomingCallsRequest.jsonrpc", - "CallHierarchyIncomingCallsRequest.method", - "CallHierarchyIncomingCallsResponse.jsonrpc", - "CallHierarchyIncomingCallsResponse.result", - "CallHierarchyOutgoingCallsRequest.jsonrpc", - "CallHierarchyOutgoingCallsRequest.method", - "CallHierarchyOutgoingCallsResponse.jsonrpc", - "CallHierarchyOutgoingCallsResponse.result", - "CallHierarchyRegistrationOptions.document_selector", - "CancelRequestNotification.jsonrpc", - "CancelRequestNotification.method", - "ClientRegisterCapabilityRequest.jsonrpc", - "ClientRegisterCapabilityRequest.method", - "ClientRegisterCapabilityResponse.jsonrpc", - "ClientRegisterCapabilityResponse.result", - "ClientUnregisterCapabilityRequest.jsonrpc", - "ClientUnregisterCapabilityRequest.method", - "ClientUnregisterCapabilityResponse.jsonrpc", - "ClientUnregisterCapabilityResponse.result", - "CodeActionRegistrationOptions.document_selector", - "CodeActionResolveRequest.jsonrpc", - "CodeActionResolveRequest.method", - "CodeActionResolveResponse.jsonrpc", - "CodeActionResolveResponse.result", - "CodeLensRegistrationOptions.document_selector", - "CodeLensResolveRequest.jsonrpc", - "CodeLensResolveRequest.method", - "CodeLensResolveResponse.jsonrpc", - "CodeLensResolveResponse.result", - "CompletionItemResolveRequest.jsonrpc", - "CompletionItemResolveRequest.method", - "CompletionItemResolveResponse.jsonrpc", - "CompletionItemResolveResponse.result", - "CompletionRegistrationOptions.document_selector", - "CreateFile.kind", - "DeclarationRegistrationOptions.document_selector", - "DefinitionRegistrationOptions.document_selector", - "DeleteFile.kind", - "DiagnosticRegistrationOptions.document_selector", - "DocumentColorRegistrationOptions.document_selector", - "DocumentFormattingRegistrationOptions.document_selector", - "DocumentHighlightRegistrationOptions.document_selector", - "DocumentLinkRegistrationOptions.document_selector", - "DocumentLinkResolveRequest.jsonrpc", - "DocumentLinkResolveRequest.method", - "DocumentLinkResolveResponse.jsonrpc", - "DocumentLinkResolveResponse.result", - "DocumentOnTypeFormattingRegistrationOptions.document_selector", - "DocumentRangeFormattingRegistrationOptions.document_selector", - "DocumentSymbolRegistrationOptions.document_selector", - "ExitNotification.jsonrpc", - "ExitNotification.method", - "FoldingRangeRegistrationOptions.document_selector", - "FullDocumentDiagnosticReport.kind", - "HoverRegistrationOptions.document_selector", - "ImplementationRegistrationOptions.document_selector", - "InitializeParams.process_id", - "InitializeParams.root_path", - "InitializeParams.root_uri", - "InitializeParams.workspace_folders", - "InitializeRequest.jsonrpc", - "InitializeRequest.method", - "InitializeResponse.jsonrpc", - "InitializeResponse.result", - "InitializedNotification.jsonrpc", - "InitializedNotification.method", - "InlayHintRegistrationOptions.document_selector", - "InlayHintResolveRequest.jsonrpc", - "InlayHintResolveRequest.method", - "InlayHintResolveResponse.jsonrpc", - "InlayHintResolveResponse.result", - "InlineCompletionRegistrationOptions.document_selector", - "InlineValueRegistrationOptions.document_selector", - "LinkedEditingRangeRegistrationOptions.document_selector", - "LogTraceNotification.jsonrpc", - "LogTraceNotification.method", - "MonikerRegistrationOptions.document_selector", - "NotebookDocumentDidChangeNotification.jsonrpc", - "NotebookDocumentDidChangeNotification.method", - "NotebookDocumentDidCloseNotification.jsonrpc", - "NotebookDocumentDidCloseNotification.method", - "NotebookDocumentDidOpenNotification.jsonrpc", - "NotebookDocumentDidOpenNotification.method", - "NotebookDocumentDidSaveNotification.jsonrpc", - "NotebookDocumentDidSaveNotification.method", - "OptionalVersionedTextDocumentIdentifier.version", - "ProgressNotification.jsonrpc", - "ProgressNotification.method", - "ReferenceRegistrationOptions.document_selector", - "RelatedFullDocumentDiagnosticReport.kind", - "RelatedUnchangedDocumentDiagnosticReport.kind", - "RenameFile.kind", - "RenameRegistrationOptions.document_selector", - "ResponseErrorMessage.error", - "ResponseErrorMessage.jsonrpc", - "SelectionRangeRegistrationOptions.document_selector", - "SemanticTokensRegistrationOptions.document_selector", - "SetTraceNotification.jsonrpc", - "SetTraceNotification.method", - "ShutdownRequest.jsonrpc", - "ShutdownRequest.method", - "ShutdownResponse.jsonrpc", - "ShutdownResponse.result", - "SignatureHelpRegistrationOptions.document_selector", - "StringValue.kind", - "TelemetryEventNotification.jsonrpc", - "TelemetryEventNotification.method", - "TextDocumentChangeRegistrationOptions.document_selector", - "TextDocumentCodeActionRequest.jsonrpc", - "TextDocumentCodeActionRequest.method", - "TextDocumentCodeActionResponse.jsonrpc", - "TextDocumentCodeActionResponse.result", - "TextDocumentCodeLensRequest.jsonrpc", - "TextDocumentCodeLensRequest.method", - "TextDocumentCodeLensResponse.jsonrpc", - "TextDocumentCodeLensResponse.result", - "TextDocumentColorPresentationOptions.document_selector", - "TextDocumentColorPresentationRequest.jsonrpc", - "TextDocumentColorPresentationRequest.method", - "TextDocumentColorPresentationResponse.jsonrpc", - "TextDocumentColorPresentationResponse.result", - "TextDocumentCompletionRequest.jsonrpc", - "TextDocumentCompletionRequest.method", - "TextDocumentCompletionResponse.jsonrpc", - "TextDocumentCompletionResponse.result", - "TextDocumentDeclarationRequest.jsonrpc", - "TextDocumentDeclarationRequest.method", - "TextDocumentDeclarationResponse.jsonrpc", - "TextDocumentDeclarationResponse.result", - "TextDocumentDefinitionRequest.jsonrpc", - "TextDocumentDefinitionRequest.method", - "TextDocumentDefinitionResponse.jsonrpc", - "TextDocumentDefinitionResponse.result", - "TextDocumentDiagnosticRequest.jsonrpc", - "TextDocumentDiagnosticRequest.method", - "TextDocumentDiagnosticResponse.jsonrpc", - "TextDocumentDiagnosticResponse.result", - "TextDocumentDidChangeNotification.jsonrpc", - "TextDocumentDidChangeNotification.method", - "TextDocumentDidCloseNotification.jsonrpc", - "TextDocumentDidCloseNotification.method", - "TextDocumentDidOpenNotification.jsonrpc", - "TextDocumentDidOpenNotification.method", - "TextDocumentDidSaveNotification.jsonrpc", - "TextDocumentDidSaveNotification.method", - "TextDocumentDocumentColorRequest.jsonrpc", - "TextDocumentDocumentColorRequest.method", - "TextDocumentDocumentColorResponse.jsonrpc", - "TextDocumentDocumentColorResponse.result", - "TextDocumentDocumentHighlightRequest.jsonrpc", - "TextDocumentDocumentHighlightRequest.method", - "TextDocumentDocumentHighlightResponse.jsonrpc", - "TextDocumentDocumentHighlightResponse.result", - "TextDocumentDocumentLinkRequest.jsonrpc", - "TextDocumentDocumentLinkRequest.method", - "TextDocumentDocumentLinkResponse.jsonrpc", - "TextDocumentDocumentLinkResponse.result", - "TextDocumentDocumentSymbolRequest.jsonrpc", - "TextDocumentDocumentSymbolRequest.method", - "TextDocumentDocumentSymbolResponse.jsonrpc", - "TextDocumentDocumentSymbolResponse.result", - "TextDocumentFoldingRangeRequest.jsonrpc", - "TextDocumentFoldingRangeRequest.method", - "TextDocumentFoldingRangeResponse.jsonrpc", - "TextDocumentFoldingRangeResponse.result", - "TextDocumentFormattingRequest.jsonrpc", - "TextDocumentFormattingRequest.method", - "TextDocumentFormattingResponse.jsonrpc", - "TextDocumentFormattingResponse.result", - "TextDocumentHoverRequest.jsonrpc", - "TextDocumentHoverRequest.method", - "TextDocumentHoverResponse.jsonrpc", - "TextDocumentHoverResponse.result", - "TextDocumentImplementationRequest.jsonrpc", - "TextDocumentImplementationRequest.method", - "TextDocumentImplementationResponse.jsonrpc", - "TextDocumentImplementationResponse.result", - "TextDocumentInlayHintRequest.jsonrpc", - "TextDocumentInlayHintRequest.method", - "TextDocumentInlayHintResponse.jsonrpc", - "TextDocumentInlayHintResponse.result", - "TextDocumentInlineCompletionRequest.jsonrpc", - "TextDocumentInlineCompletionRequest.method", - "TextDocumentInlineCompletionResponse.jsonrpc", - "TextDocumentInlineCompletionResponse.result", - "TextDocumentInlineValueRequest.jsonrpc", - "TextDocumentInlineValueRequest.method", - "TextDocumentInlineValueResponse.jsonrpc", - "TextDocumentInlineValueResponse.result", - "TextDocumentLinkedEditingRangeRequest.jsonrpc", - "TextDocumentLinkedEditingRangeRequest.method", - "TextDocumentLinkedEditingRangeResponse.jsonrpc", - "TextDocumentLinkedEditingRangeResponse.result", - "TextDocumentMonikerRequest.jsonrpc", - "TextDocumentMonikerRequest.method", - "TextDocumentMonikerResponse.jsonrpc", - "TextDocumentMonikerResponse.result", - "TextDocumentOnTypeFormattingRequest.jsonrpc", - "TextDocumentOnTypeFormattingRequest.method", - "TextDocumentOnTypeFormattingResponse.jsonrpc", - "TextDocumentOnTypeFormattingResponse.result", - "TextDocumentPrepareCallHierarchyRequest.jsonrpc", - "TextDocumentPrepareCallHierarchyRequest.method", - "TextDocumentPrepareCallHierarchyResponse.jsonrpc", - "TextDocumentPrepareCallHierarchyResponse.result", - "TextDocumentPrepareRenameRequest.jsonrpc", - "TextDocumentPrepareRenameRequest.method", - "TextDocumentPrepareRenameResponse.jsonrpc", - "TextDocumentPrepareRenameResponse.result", - "TextDocumentPrepareTypeHierarchyRequest.jsonrpc", - "TextDocumentPrepareTypeHierarchyRequest.method", - "TextDocumentPrepareTypeHierarchyResponse.jsonrpc", - "TextDocumentPrepareTypeHierarchyResponse.result", - "TextDocumentPublishDiagnosticsNotification.jsonrpc", - "TextDocumentPublishDiagnosticsNotification.method", - "TextDocumentRangeFormattingRequest.jsonrpc", - "TextDocumentRangeFormattingRequest.method", - "TextDocumentRangeFormattingResponse.jsonrpc", - "TextDocumentRangeFormattingResponse.result", - "TextDocumentRangesFormattingRequest.jsonrpc", - "TextDocumentRangesFormattingRequest.method", - "TextDocumentRangesFormattingResponse.jsonrpc", - "TextDocumentRangesFormattingResponse.result", - "TextDocumentReferencesRequest.jsonrpc", - "TextDocumentReferencesRequest.method", - "TextDocumentReferencesResponse.jsonrpc", - "TextDocumentReferencesResponse.result", - "TextDocumentRegistrationOptions.document_selector", - "TextDocumentRenameRequest.jsonrpc", - "TextDocumentRenameRequest.method", - "TextDocumentRenameResponse.jsonrpc", - "TextDocumentRenameResponse.result", - "TextDocumentSaveRegistrationOptions.document_selector", - "TextDocumentSelectionRangeRequest.jsonrpc", - "TextDocumentSelectionRangeRequest.method", - "TextDocumentSelectionRangeResponse.jsonrpc", - "TextDocumentSelectionRangeResponse.result", - "TextDocumentSemanticTokensFullDeltaRequest.jsonrpc", - "TextDocumentSemanticTokensFullDeltaRequest.method", - "TextDocumentSemanticTokensFullDeltaResponse.jsonrpc", - "TextDocumentSemanticTokensFullDeltaResponse.result", - "TextDocumentSemanticTokensFullRequest.jsonrpc", - "TextDocumentSemanticTokensFullRequest.method", - "TextDocumentSemanticTokensFullResponse.jsonrpc", - "TextDocumentSemanticTokensFullResponse.result", - "TextDocumentSemanticTokensRangeRequest.jsonrpc", - "TextDocumentSemanticTokensRangeRequest.method", - "TextDocumentSemanticTokensRangeResponse.jsonrpc", - "TextDocumentSemanticTokensRangeResponse.result", - "TextDocumentSignatureHelpRequest.jsonrpc", - "TextDocumentSignatureHelpRequest.method", - "TextDocumentSignatureHelpResponse.jsonrpc", - "TextDocumentSignatureHelpResponse.result", - "TextDocumentTypeDefinitionRequest.jsonrpc", - "TextDocumentTypeDefinitionRequest.method", - "TextDocumentTypeDefinitionResponse.jsonrpc", - "TextDocumentTypeDefinitionResponse.result", - "TextDocumentWillSaveNotification.jsonrpc", - "TextDocumentWillSaveNotification.method", - "TextDocumentWillSaveWaitUntilRequest.jsonrpc", - "TextDocumentWillSaveWaitUntilRequest.method", - "TextDocumentWillSaveWaitUntilResponse.jsonrpc", - "TextDocumentWillSaveWaitUntilResponse.result", - "TypeDefinitionRegistrationOptions.document_selector", - "TypeHierarchyRegistrationOptions.document_selector", - "TypeHierarchySubtypesRequest.jsonrpc", - "TypeHierarchySubtypesRequest.method", - "TypeHierarchySubtypesResponse.jsonrpc", - "TypeHierarchySubtypesResponse.result", - "TypeHierarchySupertypesRequest.jsonrpc", - "TypeHierarchySupertypesRequest.method", - "TypeHierarchySupertypesResponse.jsonrpc", - "TypeHierarchySupertypesResponse.result", - "UnchangedDocumentDiagnosticReport.kind", - "WindowLogMessageNotification.jsonrpc", - "WindowLogMessageNotification.method", - "WindowShowDocumentRequest.jsonrpc", - "WindowShowDocumentRequest.method", - "WindowShowDocumentResponse.jsonrpc", - "WindowShowDocumentResponse.result", - "WindowShowMessageNotification.jsonrpc", - "WindowShowMessageNotification.method", - "WindowShowMessageRequestRequest.jsonrpc", - "WindowShowMessageRequestRequest.method", - "WindowShowMessageRequestResponse.jsonrpc", - "WindowShowMessageRequestResponse.result", - "WindowWorkDoneProgressCancelNotification.jsonrpc", - "WindowWorkDoneProgressCancelNotification.method", - "WindowWorkDoneProgressCreateRequest.jsonrpc", - "WindowWorkDoneProgressCreateRequest.method", - "WindowWorkDoneProgressCreateResponse.jsonrpc", - "WindowWorkDoneProgressCreateResponse.result", - "WorkDoneProgressBegin.kind", - "WorkDoneProgressEnd.kind", - "WorkDoneProgressReport.kind", - "WorkspaceApplyEditRequest.jsonrpc", - "WorkspaceApplyEditRequest.method", - "WorkspaceApplyEditResponse.jsonrpc", - "WorkspaceApplyEditResponse.result", - "WorkspaceCodeLensRefreshRequest.jsonrpc", - "WorkspaceCodeLensRefreshRequest.method", - "WorkspaceCodeLensRefreshResponse.jsonrpc", - "WorkspaceCodeLensRefreshResponse.result", - "WorkspaceConfigurationRequest.jsonrpc", - "WorkspaceConfigurationRequest.method", - "WorkspaceConfigurationResponse.jsonrpc", - "WorkspaceConfigurationResponse.result", - "WorkspaceDiagnosticRefreshRequest.jsonrpc", - "WorkspaceDiagnosticRefreshRequest.method", - "WorkspaceDiagnosticRefreshResponse.jsonrpc", - "WorkspaceDiagnosticRefreshResponse.result", - "WorkspaceDiagnosticRequest.jsonrpc", - "WorkspaceDiagnosticRequest.method", - "WorkspaceDiagnosticResponse.jsonrpc", - "WorkspaceDiagnosticResponse.result", - "WorkspaceDidChangeConfigurationNotification.jsonrpc", - "WorkspaceDidChangeConfigurationNotification.method", - "WorkspaceDidChangeWatchedFilesNotification.jsonrpc", - "WorkspaceDidChangeWatchedFilesNotification.method", - "WorkspaceDidChangeWorkspaceFoldersNotification.jsonrpc", - "WorkspaceDidChangeWorkspaceFoldersNotification.method", - "WorkspaceDidCreateFilesNotification.jsonrpc", - "WorkspaceDidCreateFilesNotification.method", - "WorkspaceDidDeleteFilesNotification.jsonrpc", - "WorkspaceDidDeleteFilesNotification.method", - "WorkspaceDidRenameFilesNotification.jsonrpc", - "WorkspaceDidRenameFilesNotification.method", - "WorkspaceExecuteCommandRequest.jsonrpc", - "WorkspaceExecuteCommandRequest.method", - "WorkspaceExecuteCommandResponse.jsonrpc", - "WorkspaceExecuteCommandResponse.result", - "WorkspaceFoldersInitializeParams.workspace_folders", - "WorkspaceFoldingRangeRefreshRequest.jsonrpc", - "WorkspaceFoldingRangeRefreshRequest.method", - "WorkspaceFoldingRangeRefreshResponse.jsonrpc", - "WorkspaceFoldingRangeRefreshResponse.result", - "WorkspaceFullDocumentDiagnosticReport.kind", - "WorkspaceFullDocumentDiagnosticReport.version", - "WorkspaceInlayHintRefreshRequest.jsonrpc", - "WorkspaceInlayHintRefreshRequest.method", - "WorkspaceInlayHintRefreshResponse.jsonrpc", - "WorkspaceInlayHintRefreshResponse.result", - "WorkspaceInlineValueRefreshRequest.jsonrpc", - "WorkspaceInlineValueRefreshRequest.method", - "WorkspaceInlineValueRefreshResponse.jsonrpc", - "WorkspaceInlineValueRefreshResponse.result", - "WorkspaceSemanticTokensRefreshRequest.jsonrpc", - "WorkspaceSemanticTokensRefreshRequest.method", - "WorkspaceSemanticTokensRefreshResponse.jsonrpc", - "WorkspaceSemanticTokensRefreshResponse.result", - "WorkspaceSymbolRequest.jsonrpc", - "WorkspaceSymbolRequest.method", - "WorkspaceSymbolResolveRequest.jsonrpc", - "WorkspaceSymbolResolveRequest.method", - "WorkspaceSymbolResolveResponse.jsonrpc", - "WorkspaceSymbolResolveResponse.result", - "WorkspaceSymbolResponse.jsonrpc", - "WorkspaceSymbolResponse.result", - "WorkspaceUnchangedDocumentDiagnosticReport.kind", - "WorkspaceUnchangedDocumentDiagnosticReport.version", - "WorkspaceWillCreateFilesRequest.jsonrpc", - "WorkspaceWillCreateFilesRequest.method", - "WorkspaceWillCreateFilesResponse.jsonrpc", - "WorkspaceWillCreateFilesResponse.result", - "WorkspaceWillDeleteFilesRequest.jsonrpc", - "WorkspaceWillDeleteFilesRequest.method", - "WorkspaceWillDeleteFilesResponse.jsonrpc", - "WorkspaceWillDeleteFilesResponse.result", - "WorkspaceWillRenameFilesRequest.jsonrpc", - "WorkspaceWillRenameFilesRequest.method", - "WorkspaceWillRenameFilesResponse.jsonrpc", - "WorkspaceWillRenameFilesResponse.result", - "WorkspaceWorkspaceFoldersRequest.jsonrpc", - "WorkspaceWorkspaceFoldersRequest.method", - "WorkspaceWorkspaceFoldersResponse.jsonrpc", - "WorkspaceWorkspaceFoldersResponse.result", - "_InitializeParams.process_id", - "_InitializeParams.root_path", - "_InitializeParams.root_uri", -] - - -def is_special_property(cls: type, property_name: str) -> bool: - """Returns true if the class or its properties require special handling. - Example: - Consider RenameRegistrationOptions - * document_selector property: - When you set `document_selector` to None in python it has to be preserved when - serializing it. Since the serialized JSON value `{"document_selector": null}` - means use the Clients document selector. Omitting it might throw error. - * prepare_provider property - This property does NOT need special handling, since omitting it or using - `{"prepare_provider": null}` in JSON has the same meaning. - """ - qualified_name = f"{cls.__name__}.{property_name}" - return qualified_name in _SPECIAL_PROPERTIES - - -ALL_TYPES_MAP: Dict[str, Union[type, object]] = { - "AnnotatedTextEdit": AnnotatedTextEdit, - "ApplyWorkspaceEditParams": ApplyWorkspaceEditParams, - "ApplyWorkspaceEditResult": ApplyWorkspaceEditResult, - "BaseSymbolInformation": BaseSymbolInformation, - "CallHierarchyClientCapabilities": CallHierarchyClientCapabilities, - "CallHierarchyIncomingCall": CallHierarchyIncomingCall, - "CallHierarchyIncomingCallsParams": CallHierarchyIncomingCallsParams, - "CallHierarchyIncomingCallsRequest": CallHierarchyIncomingCallsRequest, - "CallHierarchyIncomingCallsResponse": CallHierarchyIncomingCallsResponse, - "CallHierarchyItem": CallHierarchyItem, - "CallHierarchyOptions": CallHierarchyOptions, - "CallHierarchyOutgoingCall": CallHierarchyOutgoingCall, - "CallHierarchyOutgoingCallsParams": CallHierarchyOutgoingCallsParams, - "CallHierarchyOutgoingCallsRequest": CallHierarchyOutgoingCallsRequest, - "CallHierarchyOutgoingCallsResponse": CallHierarchyOutgoingCallsResponse, - "CallHierarchyPrepareParams": CallHierarchyPrepareParams, - "CallHierarchyRegistrationOptions": CallHierarchyRegistrationOptions, - "CancelParams": CancelParams, - "CancelRequestNotification": CancelRequestNotification, - "ChangeAnnotation": ChangeAnnotation, - "ChangeAnnotationIdentifier": ChangeAnnotationIdentifier, - "ChangeAnnotationsSupportOptions": ChangeAnnotationsSupportOptions, - "ClientCapabilities": ClientCapabilities, - "ClientCodeActionKindOptions": ClientCodeActionKindOptions, - "ClientCodeActionLiteralOptions": ClientCodeActionLiteralOptions, - "ClientCodeActionResolveOptions": ClientCodeActionResolveOptions, - "ClientCompletionItemInsertTextModeOptions": ClientCompletionItemInsertTextModeOptions, - "ClientCompletionItemOptions": ClientCompletionItemOptions, - "ClientCompletionItemOptionsKind": ClientCompletionItemOptionsKind, - "ClientCompletionItemResolveOptions": ClientCompletionItemResolveOptions, - "ClientDiagnosticsTagOptions": ClientDiagnosticsTagOptions, - "ClientFoldingRangeKindOptions": ClientFoldingRangeKindOptions, - "ClientFoldingRangeOptions": ClientFoldingRangeOptions, - "ClientInfo": ClientInfo, - "ClientInlayHintResolveOptions": ClientInlayHintResolveOptions, - "ClientRegisterCapabilityRequest": ClientRegisterCapabilityRequest, - "ClientRegisterCapabilityResponse": ClientRegisterCapabilityResponse, - "ClientSemanticTokensRequestFullDelta": ClientSemanticTokensRequestFullDelta, - "ClientSemanticTokensRequestOptions": ClientSemanticTokensRequestOptions, - "ClientShowMessageActionItemOptions": ClientShowMessageActionItemOptions, - "ClientSignatureInformationOptions": ClientSignatureInformationOptions, - "ClientSignatureParameterInformationOptions": ClientSignatureParameterInformationOptions, - "ClientSymbolKindOptions": ClientSymbolKindOptions, - "ClientSymbolResolveOptions": ClientSymbolResolveOptions, - "ClientSymbolTagOptions": ClientSymbolTagOptions, - "ClientUnregisterCapabilityRequest": ClientUnregisterCapabilityRequest, - "ClientUnregisterCapabilityResponse": ClientUnregisterCapabilityResponse, - "CodeAction": CodeAction, - "CodeActionClientCapabilities": CodeActionClientCapabilities, - "CodeActionContext": CodeActionContext, - "CodeActionDisabled": CodeActionDisabled, - "CodeActionKind": CodeActionKind, - "CodeActionOptions": CodeActionOptions, - "CodeActionParams": CodeActionParams, - "CodeActionRegistrationOptions": CodeActionRegistrationOptions, - "CodeActionResolveRequest": CodeActionResolveRequest, - "CodeActionResolveResponse": CodeActionResolveResponse, - "CodeActionTriggerKind": CodeActionTriggerKind, - "CodeDescription": CodeDescription, - "CodeLens": CodeLens, - "CodeLensClientCapabilities": CodeLensClientCapabilities, - "CodeLensOptions": CodeLensOptions, - "CodeLensParams": CodeLensParams, - "CodeLensRegistrationOptions": CodeLensRegistrationOptions, - "CodeLensResolveRequest": CodeLensResolveRequest, - "CodeLensResolveResponse": CodeLensResolveResponse, - "CodeLensWorkspaceClientCapabilities": CodeLensWorkspaceClientCapabilities, - "Color": Color, - "ColorInformation": ColorInformation, - "ColorPresentation": ColorPresentation, - "ColorPresentationParams": ColorPresentationParams, - "Command": Command, - "CompletionClientCapabilities": CompletionClientCapabilities, - "CompletionContext": CompletionContext, - "CompletionItem": CompletionItem, - "CompletionItemDefaults": CompletionItemDefaults, - "CompletionItemKind": CompletionItemKind, - "CompletionItemLabelDetails": CompletionItemLabelDetails, - "CompletionItemResolveRequest": CompletionItemResolveRequest, - "CompletionItemResolveResponse": CompletionItemResolveResponse, - "CompletionItemTag": CompletionItemTag, - "CompletionItemTagOptions": CompletionItemTagOptions, - "CompletionList": CompletionList, - "CompletionListCapabilities": CompletionListCapabilities, - "CompletionOptions": CompletionOptions, - "CompletionParams": CompletionParams, - "CompletionRegistrationOptions": CompletionRegistrationOptions, - "CompletionTriggerKind": CompletionTriggerKind, - "ConfigurationItem": ConfigurationItem, - "ConfigurationParams": ConfigurationParams, - "CreateFile": CreateFile, - "CreateFileOptions": CreateFileOptions, - "CreateFilesParams": CreateFilesParams, - "Declaration": Declaration, - "DeclarationClientCapabilities": DeclarationClientCapabilities, - "DeclarationLink": DeclarationLink, - "DeclarationOptions": DeclarationOptions, - "DeclarationParams": DeclarationParams, - "DeclarationRegistrationOptions": DeclarationRegistrationOptions, - "Definition": Definition, - "DefinitionClientCapabilities": DefinitionClientCapabilities, - "DefinitionLink": DefinitionLink, - "DefinitionOptions": DefinitionOptions, - "DefinitionParams": DefinitionParams, - "DefinitionRegistrationOptions": DefinitionRegistrationOptions, - "DeleteFile": DeleteFile, - "DeleteFileOptions": DeleteFileOptions, - "DeleteFilesParams": DeleteFilesParams, - "Diagnostic": Diagnostic, - "DiagnosticClientCapabilities": DiagnosticClientCapabilities, - "DiagnosticOptions": DiagnosticOptions, - "DiagnosticRegistrationOptions": DiagnosticRegistrationOptions, - "DiagnosticRelatedInformation": DiagnosticRelatedInformation, - "DiagnosticServerCancellationData": DiagnosticServerCancellationData, - "DiagnosticSeverity": DiagnosticSeverity, - "DiagnosticTag": DiagnosticTag, - "DiagnosticWorkspaceClientCapabilities": DiagnosticWorkspaceClientCapabilities, - "DidChangeConfigurationClientCapabilities": DidChangeConfigurationClientCapabilities, - "DidChangeConfigurationParams": DidChangeConfigurationParams, - "DidChangeConfigurationRegistrationOptions": DidChangeConfigurationRegistrationOptions, - "DidChangeNotebookDocumentParams": DidChangeNotebookDocumentParams, - "DidChangeTextDocumentParams": DidChangeTextDocumentParams, - "DidChangeWatchedFilesClientCapabilities": DidChangeWatchedFilesClientCapabilities, - "DidChangeWatchedFilesParams": DidChangeWatchedFilesParams, - "DidChangeWatchedFilesRegistrationOptions": DidChangeWatchedFilesRegistrationOptions, - "DidChangeWorkspaceFoldersParams": DidChangeWorkspaceFoldersParams, - "DidCloseNotebookDocumentParams": DidCloseNotebookDocumentParams, - "DidCloseTextDocumentParams": DidCloseTextDocumentParams, - "DidOpenNotebookDocumentParams": DidOpenNotebookDocumentParams, - "DidOpenTextDocumentParams": DidOpenTextDocumentParams, - "DidSaveNotebookDocumentParams": DidSaveNotebookDocumentParams, - "DidSaveTextDocumentParams": DidSaveTextDocumentParams, - "DocumentColorClientCapabilities": DocumentColorClientCapabilities, - "DocumentColorOptions": DocumentColorOptions, - "DocumentColorParams": DocumentColorParams, - "DocumentColorRegistrationOptions": DocumentColorRegistrationOptions, - "DocumentDiagnosticParams": DocumentDiagnosticParams, - "DocumentDiagnosticReport": DocumentDiagnosticReport, - "DocumentDiagnosticReportKind": DocumentDiagnosticReportKind, - "DocumentDiagnosticReportPartialResult": DocumentDiagnosticReportPartialResult, - "DocumentFilter": DocumentFilter, - "DocumentFormattingClientCapabilities": DocumentFormattingClientCapabilities, - "DocumentFormattingOptions": DocumentFormattingOptions, - "DocumentFormattingParams": DocumentFormattingParams, - "DocumentFormattingRegistrationOptions": DocumentFormattingRegistrationOptions, - "DocumentHighlight": DocumentHighlight, - "DocumentHighlightClientCapabilities": DocumentHighlightClientCapabilities, - "DocumentHighlightKind": DocumentHighlightKind, - "DocumentHighlightOptions": DocumentHighlightOptions, - "DocumentHighlightParams": DocumentHighlightParams, - "DocumentHighlightRegistrationOptions": DocumentHighlightRegistrationOptions, - "DocumentLink": DocumentLink, - "DocumentLinkClientCapabilities": DocumentLinkClientCapabilities, - "DocumentLinkOptions": DocumentLinkOptions, - "DocumentLinkParams": DocumentLinkParams, - "DocumentLinkRegistrationOptions": DocumentLinkRegistrationOptions, - "DocumentLinkResolveRequest": DocumentLinkResolveRequest, - "DocumentLinkResolveResponse": DocumentLinkResolveResponse, - "DocumentOnTypeFormattingClientCapabilities": DocumentOnTypeFormattingClientCapabilities, - "DocumentOnTypeFormattingOptions": DocumentOnTypeFormattingOptions, - "DocumentOnTypeFormattingParams": DocumentOnTypeFormattingParams, - "DocumentOnTypeFormattingRegistrationOptions": DocumentOnTypeFormattingRegistrationOptions, - "DocumentRangeFormattingClientCapabilities": DocumentRangeFormattingClientCapabilities, - "DocumentRangeFormattingOptions": DocumentRangeFormattingOptions, - "DocumentRangeFormattingParams": DocumentRangeFormattingParams, - "DocumentRangeFormattingRegistrationOptions": DocumentRangeFormattingRegistrationOptions, - "DocumentRangesFormattingParams": DocumentRangesFormattingParams, - "DocumentSelector": DocumentSelector, - "DocumentSymbol": DocumentSymbol, - "DocumentSymbolClientCapabilities": DocumentSymbolClientCapabilities, - "DocumentSymbolOptions": DocumentSymbolOptions, - "DocumentSymbolParams": DocumentSymbolParams, - "DocumentSymbolRegistrationOptions": DocumentSymbolRegistrationOptions, - "EditRangeWithInsertReplace": EditRangeWithInsertReplace, - "ErrorCodes": ErrorCodes, - "ExecuteCommandClientCapabilities": ExecuteCommandClientCapabilities, - "ExecuteCommandOptions": ExecuteCommandOptions, - "ExecuteCommandParams": ExecuteCommandParams, - "ExecuteCommandRegistrationOptions": ExecuteCommandRegistrationOptions, - "ExecutionSummary": ExecutionSummary, - "ExitNotification": ExitNotification, - "FailureHandlingKind": FailureHandlingKind, - "FileChangeType": FileChangeType, - "FileCreate": FileCreate, - "FileDelete": FileDelete, - "FileEvent": FileEvent, - "FileOperationClientCapabilities": FileOperationClientCapabilities, - "FileOperationFilter": FileOperationFilter, - "FileOperationOptions": FileOperationOptions, - "FileOperationPattern": FileOperationPattern, - "FileOperationPatternKind": FileOperationPatternKind, - "FileOperationPatternOptions": FileOperationPatternOptions, - "FileOperationRegistrationOptions": FileOperationRegistrationOptions, - "FileRename": FileRename, - "FileSystemWatcher": FileSystemWatcher, - "FoldingRange": FoldingRange, - "FoldingRangeClientCapabilities": FoldingRangeClientCapabilities, - "FoldingRangeKind": FoldingRangeKind, - "FoldingRangeOptions": FoldingRangeOptions, - "FoldingRangeParams": FoldingRangeParams, - "FoldingRangeRegistrationOptions": FoldingRangeRegistrationOptions, - "FoldingRangeWorkspaceClientCapabilities": FoldingRangeWorkspaceClientCapabilities, - "FormattingOptions": FormattingOptions, - "FullDocumentDiagnosticReport": FullDocumentDiagnosticReport, - "GeneralClientCapabilities": GeneralClientCapabilities, - "GlobPattern": GlobPattern, - "Hover": Hover, - "HoverClientCapabilities": HoverClientCapabilities, - "HoverOptions": HoverOptions, - "HoverParams": HoverParams, - "HoverRegistrationOptions": HoverRegistrationOptions, - "ImplementationClientCapabilities": ImplementationClientCapabilities, - "ImplementationOptions": ImplementationOptions, - "ImplementationParams": ImplementationParams, - "ImplementationRegistrationOptions": ImplementationRegistrationOptions, - "InitializeError": InitializeError, - "InitializeParams": InitializeParams, - "InitializeRequest": InitializeRequest, - "InitializeResponse": InitializeResponse, - "InitializeResult": InitializeResult, - "InitializedNotification": InitializedNotification, - "InitializedParams": InitializedParams, - "InlayHint": InlayHint, - "InlayHintClientCapabilities": InlayHintClientCapabilities, - "InlayHintKind": InlayHintKind, - "InlayHintLabelPart": InlayHintLabelPart, - "InlayHintOptions": InlayHintOptions, - "InlayHintParams": InlayHintParams, - "InlayHintRegistrationOptions": InlayHintRegistrationOptions, - "InlayHintResolveRequest": InlayHintResolveRequest, - "InlayHintResolveResponse": InlayHintResolveResponse, - "InlayHintWorkspaceClientCapabilities": InlayHintWorkspaceClientCapabilities, - "InlineCompletionClientCapabilities": InlineCompletionClientCapabilities, - "InlineCompletionContext": InlineCompletionContext, - "InlineCompletionItem": InlineCompletionItem, - "InlineCompletionList": InlineCompletionList, - "InlineCompletionOptions": InlineCompletionOptions, - "InlineCompletionParams": InlineCompletionParams, - "InlineCompletionRegistrationOptions": InlineCompletionRegistrationOptions, - "InlineCompletionTriggerKind": InlineCompletionTriggerKind, - "InlineValue": InlineValue, - "InlineValueClientCapabilities": InlineValueClientCapabilities, - "InlineValueContext": InlineValueContext, - "InlineValueEvaluatableExpression": InlineValueEvaluatableExpression, - "InlineValueOptions": InlineValueOptions, - "InlineValueParams": InlineValueParams, - "InlineValueRegistrationOptions": InlineValueRegistrationOptions, - "InlineValueText": InlineValueText, - "InlineValueVariableLookup": InlineValueVariableLookup, - "InlineValueWorkspaceClientCapabilities": InlineValueWorkspaceClientCapabilities, - "InsertReplaceEdit": InsertReplaceEdit, - "InsertTextFormat": InsertTextFormat, - "InsertTextMode": InsertTextMode, - "LSPAny": LSPAny, - "LSPArray": LSPArray, - "LSPErrorCodes": LSPErrorCodes, - "LSPObject": LSPObject, - "LinkedEditingRangeClientCapabilities": LinkedEditingRangeClientCapabilities, - "LinkedEditingRangeOptions": LinkedEditingRangeOptions, - "LinkedEditingRangeParams": LinkedEditingRangeParams, - "LinkedEditingRangeRegistrationOptions": LinkedEditingRangeRegistrationOptions, - "LinkedEditingRanges": LinkedEditingRanges, - "Location": Location, - "LocationLink": LocationLink, - "LocationUriOnly": LocationUriOnly, - "LogMessageParams": LogMessageParams, - "LogTraceNotification": LogTraceNotification, - "LogTraceParams": LogTraceParams, - "MarkdownClientCapabilities": MarkdownClientCapabilities, - "MarkedString": MarkedString, - "MarkedStringWithLanguage": MarkedStringWithLanguage, - "MarkupContent": MarkupContent, - "MarkupKind": MarkupKind, - "MessageActionItem": MessageActionItem, - "MessageDirection": MessageDirection, - "MessageType": MessageType, - "Moniker": Moniker, - "MonikerClientCapabilities": MonikerClientCapabilities, - "MonikerKind": MonikerKind, - "MonikerOptions": MonikerOptions, - "MonikerParams": MonikerParams, - "MonikerRegistrationOptions": MonikerRegistrationOptions, - "NotebookCell": NotebookCell, - "NotebookCellArrayChange": NotebookCellArrayChange, - "NotebookCellKind": NotebookCellKind, - "NotebookCellLanguage": NotebookCellLanguage, - "NotebookCellTextDocumentFilter": NotebookCellTextDocumentFilter, - "NotebookDocument": NotebookDocument, - "NotebookDocumentCellChangeStructure": NotebookDocumentCellChangeStructure, - "NotebookDocumentCellChanges": NotebookDocumentCellChanges, - "NotebookDocumentCellContentChanges": NotebookDocumentCellContentChanges, - "NotebookDocumentChangeEvent": NotebookDocumentChangeEvent, - "NotebookDocumentClientCapabilities": NotebookDocumentClientCapabilities, - "NotebookDocumentDidChangeNotification": NotebookDocumentDidChangeNotification, - "NotebookDocumentDidCloseNotification": NotebookDocumentDidCloseNotification, - "NotebookDocumentDidOpenNotification": NotebookDocumentDidOpenNotification, - "NotebookDocumentDidSaveNotification": NotebookDocumentDidSaveNotification, - "NotebookDocumentFilter": NotebookDocumentFilter, - "NotebookDocumentFilterNotebookType": NotebookDocumentFilterNotebookType, - "NotebookDocumentFilterPattern": NotebookDocumentFilterPattern, - "NotebookDocumentFilterScheme": NotebookDocumentFilterScheme, - "NotebookDocumentFilterWithCells": NotebookDocumentFilterWithCells, - "NotebookDocumentFilterWithNotebook": NotebookDocumentFilterWithNotebook, - "NotebookDocumentIdentifier": NotebookDocumentIdentifier, - "NotebookDocumentSyncClientCapabilities": NotebookDocumentSyncClientCapabilities, - "NotebookDocumentSyncOptions": NotebookDocumentSyncOptions, - "NotebookDocumentSyncRegistrationOptions": NotebookDocumentSyncRegistrationOptions, - "OptionalVersionedTextDocumentIdentifier": OptionalVersionedTextDocumentIdentifier, - "ParameterInformation": ParameterInformation, - "PartialResultParams": PartialResultParams, - "Pattern": Pattern, - "Position": Position, - "PositionEncodingKind": PositionEncodingKind, - "PrepareRenameDefaultBehavior": PrepareRenameDefaultBehavior, - "PrepareRenameParams": PrepareRenameParams, - "PrepareRenamePlaceholder": PrepareRenamePlaceholder, - "PrepareRenameResult": PrepareRenameResult, - "PrepareSupportDefaultBehavior": PrepareSupportDefaultBehavior, - "PreviousResultId": PreviousResultId, - "ProgressNotification": ProgressNotification, - "ProgressParams": ProgressParams, - "ProgressToken": ProgressToken, - "PublishDiagnosticsClientCapabilities": PublishDiagnosticsClientCapabilities, - "PublishDiagnosticsParams": PublishDiagnosticsParams, - "Range": Range, - "ReferenceClientCapabilities": ReferenceClientCapabilities, - "ReferenceContext": ReferenceContext, - "ReferenceOptions": ReferenceOptions, - "ReferenceParams": ReferenceParams, - "ReferenceRegistrationOptions": ReferenceRegistrationOptions, - "Registration": Registration, - "RegistrationParams": RegistrationParams, - "RegularExpressionsClientCapabilities": RegularExpressionsClientCapabilities, - "RelatedFullDocumentDiagnosticReport": RelatedFullDocumentDiagnosticReport, - "RelatedUnchangedDocumentDiagnosticReport": RelatedUnchangedDocumentDiagnosticReport, - "RelativePattern": RelativePattern, - "RenameClientCapabilities": RenameClientCapabilities, - "RenameFile": RenameFile, - "RenameFileOptions": RenameFileOptions, - "RenameFilesParams": RenameFilesParams, - "RenameOptions": RenameOptions, - "RenameParams": RenameParams, - "RenameRegistrationOptions": RenameRegistrationOptions, - "ResourceOperation": ResourceOperation, - "ResourceOperationKind": ResourceOperationKind, - "ResponseError": ResponseError, - "ResponseErrorMessage": ResponseErrorMessage, - "SaveOptions": SaveOptions, - "SelectedCompletionInfo": SelectedCompletionInfo, - "SelectionRange": SelectionRange, - "SelectionRangeClientCapabilities": SelectionRangeClientCapabilities, - "SelectionRangeOptions": SelectionRangeOptions, - "SelectionRangeParams": SelectionRangeParams, - "SelectionRangeRegistrationOptions": SelectionRangeRegistrationOptions, - "SemanticTokenModifiers": SemanticTokenModifiers, - "SemanticTokenTypes": SemanticTokenTypes, - "SemanticTokens": SemanticTokens, - "SemanticTokensClientCapabilities": SemanticTokensClientCapabilities, - "SemanticTokensDelta": SemanticTokensDelta, - "SemanticTokensDeltaParams": SemanticTokensDeltaParams, - "SemanticTokensDeltaPartialResult": SemanticTokensDeltaPartialResult, - "SemanticTokensEdit": SemanticTokensEdit, - "SemanticTokensFullDelta": SemanticTokensFullDelta, - "SemanticTokensLegend": SemanticTokensLegend, - "SemanticTokensOptions": SemanticTokensOptions, - "SemanticTokensParams": SemanticTokensParams, - "SemanticTokensPartialResult": SemanticTokensPartialResult, - "SemanticTokensRangeParams": SemanticTokensRangeParams, - "SemanticTokensRegistrationOptions": SemanticTokensRegistrationOptions, - "SemanticTokensWorkspaceClientCapabilities": SemanticTokensWorkspaceClientCapabilities, - "ServerCapabilities": ServerCapabilities, - "ServerCompletionItemOptions": ServerCompletionItemOptions, - "ServerInfo": ServerInfo, - "SetTraceNotification": SetTraceNotification, - "SetTraceParams": SetTraceParams, - "ShowDocumentClientCapabilities": ShowDocumentClientCapabilities, - "ShowDocumentParams": ShowDocumentParams, - "ShowDocumentResult": ShowDocumentResult, - "ShowMessageParams": ShowMessageParams, - "ShowMessageRequestClientCapabilities": ShowMessageRequestClientCapabilities, - "ShowMessageRequestParams": ShowMessageRequestParams, - "ShutdownRequest": ShutdownRequest, - "ShutdownResponse": ShutdownResponse, - "SignatureHelp": SignatureHelp, - "SignatureHelpClientCapabilities": SignatureHelpClientCapabilities, - "SignatureHelpContext": SignatureHelpContext, - "SignatureHelpOptions": SignatureHelpOptions, - "SignatureHelpParams": SignatureHelpParams, - "SignatureHelpRegistrationOptions": SignatureHelpRegistrationOptions, - "SignatureHelpTriggerKind": SignatureHelpTriggerKind, - "SignatureInformation": SignatureInformation, - "StaleRequestSupportOptions": StaleRequestSupportOptions, - "StaticRegistrationOptions": StaticRegistrationOptions, - "StringValue": StringValue, - "SymbolInformation": SymbolInformation, - "SymbolKind": SymbolKind, - "SymbolTag": SymbolTag, - "TelemetryEventNotification": TelemetryEventNotification, - "TextDocumentChangeRegistrationOptions": TextDocumentChangeRegistrationOptions, - "TextDocumentClientCapabilities": TextDocumentClientCapabilities, - "TextDocumentCodeActionRequest": TextDocumentCodeActionRequest, - "TextDocumentCodeActionResponse": TextDocumentCodeActionResponse, - "TextDocumentCodeLensRequest": TextDocumentCodeLensRequest, - "TextDocumentCodeLensResponse": TextDocumentCodeLensResponse, - "TextDocumentColorPresentationOptions": TextDocumentColorPresentationOptions, - "TextDocumentColorPresentationRequest": TextDocumentColorPresentationRequest, - "TextDocumentColorPresentationResponse": TextDocumentColorPresentationResponse, - "TextDocumentCompletionRequest": TextDocumentCompletionRequest, - "TextDocumentCompletionResponse": TextDocumentCompletionResponse, - "TextDocumentContentChangeEvent": TextDocumentContentChangeEvent, - "TextDocumentContentChangePartial": TextDocumentContentChangePartial, - "TextDocumentContentChangeWholeDocument": TextDocumentContentChangeWholeDocument, - "TextDocumentDeclarationRequest": TextDocumentDeclarationRequest, - "TextDocumentDeclarationResponse": TextDocumentDeclarationResponse, - "TextDocumentDefinitionRequest": TextDocumentDefinitionRequest, - "TextDocumentDefinitionResponse": TextDocumentDefinitionResponse, - "TextDocumentDiagnosticRequest": TextDocumentDiagnosticRequest, - "TextDocumentDiagnosticResponse": TextDocumentDiagnosticResponse, - "TextDocumentDidChangeNotification": TextDocumentDidChangeNotification, - "TextDocumentDidCloseNotification": TextDocumentDidCloseNotification, - "TextDocumentDidOpenNotification": TextDocumentDidOpenNotification, - "TextDocumentDidSaveNotification": TextDocumentDidSaveNotification, - "TextDocumentDocumentColorRequest": TextDocumentDocumentColorRequest, - "TextDocumentDocumentColorResponse": TextDocumentDocumentColorResponse, - "TextDocumentDocumentHighlightRequest": TextDocumentDocumentHighlightRequest, - "TextDocumentDocumentHighlightResponse": TextDocumentDocumentHighlightResponse, - "TextDocumentDocumentLinkRequest": TextDocumentDocumentLinkRequest, - "TextDocumentDocumentLinkResponse": TextDocumentDocumentLinkResponse, - "TextDocumentDocumentSymbolRequest": TextDocumentDocumentSymbolRequest, - "TextDocumentDocumentSymbolResponse": TextDocumentDocumentSymbolResponse, - "TextDocumentEdit": TextDocumentEdit, - "TextDocumentFilter": TextDocumentFilter, - "TextDocumentFilterLanguage": TextDocumentFilterLanguage, - "TextDocumentFilterPattern": TextDocumentFilterPattern, - "TextDocumentFilterScheme": TextDocumentFilterScheme, - "TextDocumentFoldingRangeRequest": TextDocumentFoldingRangeRequest, - "TextDocumentFoldingRangeResponse": TextDocumentFoldingRangeResponse, - "TextDocumentFormattingRequest": TextDocumentFormattingRequest, - "TextDocumentFormattingResponse": TextDocumentFormattingResponse, - "TextDocumentHoverRequest": TextDocumentHoverRequest, - "TextDocumentHoverResponse": TextDocumentHoverResponse, - "TextDocumentIdentifier": TextDocumentIdentifier, - "TextDocumentImplementationRequest": TextDocumentImplementationRequest, - "TextDocumentImplementationResponse": TextDocumentImplementationResponse, - "TextDocumentInlayHintRequest": TextDocumentInlayHintRequest, - "TextDocumentInlayHintResponse": TextDocumentInlayHintResponse, - "TextDocumentInlineCompletionRequest": TextDocumentInlineCompletionRequest, - "TextDocumentInlineCompletionResponse": TextDocumentInlineCompletionResponse, - "TextDocumentInlineValueRequest": TextDocumentInlineValueRequest, - "TextDocumentInlineValueResponse": TextDocumentInlineValueResponse, - "TextDocumentItem": TextDocumentItem, - "TextDocumentLinkedEditingRangeRequest": TextDocumentLinkedEditingRangeRequest, - "TextDocumentLinkedEditingRangeResponse": TextDocumentLinkedEditingRangeResponse, - "TextDocumentMonikerRequest": TextDocumentMonikerRequest, - "TextDocumentMonikerResponse": TextDocumentMonikerResponse, - "TextDocumentOnTypeFormattingRequest": TextDocumentOnTypeFormattingRequest, - "TextDocumentOnTypeFormattingResponse": TextDocumentOnTypeFormattingResponse, - "TextDocumentPositionParams": TextDocumentPositionParams, - "TextDocumentPrepareCallHierarchyRequest": TextDocumentPrepareCallHierarchyRequest, - "TextDocumentPrepareCallHierarchyResponse": TextDocumentPrepareCallHierarchyResponse, - "TextDocumentPrepareRenameRequest": TextDocumentPrepareRenameRequest, - "TextDocumentPrepareRenameResponse": TextDocumentPrepareRenameResponse, - "TextDocumentPrepareTypeHierarchyRequest": TextDocumentPrepareTypeHierarchyRequest, - "TextDocumentPrepareTypeHierarchyResponse": TextDocumentPrepareTypeHierarchyResponse, - "TextDocumentPublishDiagnosticsNotification": TextDocumentPublishDiagnosticsNotification, - "TextDocumentRangeFormattingRequest": TextDocumentRangeFormattingRequest, - "TextDocumentRangeFormattingResponse": TextDocumentRangeFormattingResponse, - "TextDocumentRangesFormattingRequest": TextDocumentRangesFormattingRequest, - "TextDocumentRangesFormattingResponse": TextDocumentRangesFormattingResponse, - "TextDocumentReferencesRequest": TextDocumentReferencesRequest, - "TextDocumentReferencesResponse": TextDocumentReferencesResponse, - "TextDocumentRegistrationOptions": TextDocumentRegistrationOptions, - "TextDocumentRenameRequest": TextDocumentRenameRequest, - "TextDocumentRenameResponse": TextDocumentRenameResponse, - "TextDocumentSaveReason": TextDocumentSaveReason, - "TextDocumentSaveRegistrationOptions": TextDocumentSaveRegistrationOptions, - "TextDocumentSelectionRangeRequest": TextDocumentSelectionRangeRequest, - "TextDocumentSelectionRangeResponse": TextDocumentSelectionRangeResponse, - "TextDocumentSemanticTokensFullDeltaRequest": TextDocumentSemanticTokensFullDeltaRequest, - "TextDocumentSemanticTokensFullDeltaResponse": TextDocumentSemanticTokensFullDeltaResponse, - "TextDocumentSemanticTokensFullRequest": TextDocumentSemanticTokensFullRequest, - "TextDocumentSemanticTokensFullResponse": TextDocumentSemanticTokensFullResponse, - "TextDocumentSemanticTokensRangeRequest": TextDocumentSemanticTokensRangeRequest, - "TextDocumentSemanticTokensRangeResponse": TextDocumentSemanticTokensRangeResponse, - "TextDocumentSignatureHelpRequest": TextDocumentSignatureHelpRequest, - "TextDocumentSignatureHelpResponse": TextDocumentSignatureHelpResponse, - "TextDocumentSyncClientCapabilities": TextDocumentSyncClientCapabilities, - "TextDocumentSyncKind": TextDocumentSyncKind, - "TextDocumentSyncOptions": TextDocumentSyncOptions, - "TextDocumentTypeDefinitionRequest": TextDocumentTypeDefinitionRequest, - "TextDocumentTypeDefinitionResponse": TextDocumentTypeDefinitionResponse, - "TextDocumentWillSaveNotification": TextDocumentWillSaveNotification, - "TextDocumentWillSaveWaitUntilRequest": TextDocumentWillSaveWaitUntilRequest, - "TextDocumentWillSaveWaitUntilResponse": TextDocumentWillSaveWaitUntilResponse, - "TextEdit": TextEdit, - "TokenFormat": TokenFormat, - "TraceValues": TraceValues, - "TypeDefinitionClientCapabilities": TypeDefinitionClientCapabilities, - "TypeDefinitionOptions": TypeDefinitionOptions, - "TypeDefinitionParams": TypeDefinitionParams, - "TypeDefinitionRegistrationOptions": TypeDefinitionRegistrationOptions, - "TypeHierarchyClientCapabilities": TypeHierarchyClientCapabilities, - "TypeHierarchyItem": TypeHierarchyItem, - "TypeHierarchyOptions": TypeHierarchyOptions, - "TypeHierarchyPrepareParams": TypeHierarchyPrepareParams, - "TypeHierarchyRegistrationOptions": TypeHierarchyRegistrationOptions, - "TypeHierarchySubtypesParams": TypeHierarchySubtypesParams, - "TypeHierarchySubtypesRequest": TypeHierarchySubtypesRequest, - "TypeHierarchySubtypesResponse": TypeHierarchySubtypesResponse, - "TypeHierarchySupertypesParams": TypeHierarchySupertypesParams, - "TypeHierarchySupertypesRequest": TypeHierarchySupertypesRequest, - "TypeHierarchySupertypesResponse": TypeHierarchySupertypesResponse, - "UnchangedDocumentDiagnosticReport": UnchangedDocumentDiagnosticReport, - "UniquenessLevel": UniquenessLevel, - "Unregistration": Unregistration, - "UnregistrationParams": UnregistrationParams, - "VersionedNotebookDocumentIdentifier": VersionedNotebookDocumentIdentifier, - "VersionedTextDocumentIdentifier": VersionedTextDocumentIdentifier, - "WatchKind": WatchKind, - "WillSaveTextDocumentParams": WillSaveTextDocumentParams, - "WindowClientCapabilities": WindowClientCapabilities, - "WindowLogMessageNotification": WindowLogMessageNotification, - "WindowShowDocumentRequest": WindowShowDocumentRequest, - "WindowShowDocumentResponse": WindowShowDocumentResponse, - "WindowShowMessageNotification": WindowShowMessageNotification, - "WindowShowMessageRequestRequest": WindowShowMessageRequestRequest, - "WindowShowMessageRequestResponse": WindowShowMessageRequestResponse, - "WindowWorkDoneProgressCancelNotification": WindowWorkDoneProgressCancelNotification, - "WindowWorkDoneProgressCreateRequest": WindowWorkDoneProgressCreateRequest, - "WindowWorkDoneProgressCreateResponse": WindowWorkDoneProgressCreateResponse, - "WorkDoneProgressBegin": WorkDoneProgressBegin, - "WorkDoneProgressCancelParams": WorkDoneProgressCancelParams, - "WorkDoneProgressCreateParams": WorkDoneProgressCreateParams, - "WorkDoneProgressEnd": WorkDoneProgressEnd, - "WorkDoneProgressOptions": WorkDoneProgressOptions, - "WorkDoneProgressParams": WorkDoneProgressParams, - "WorkDoneProgressReport": WorkDoneProgressReport, - "WorkspaceApplyEditRequest": WorkspaceApplyEditRequest, - "WorkspaceApplyEditResponse": WorkspaceApplyEditResponse, - "WorkspaceClientCapabilities": WorkspaceClientCapabilities, - "WorkspaceCodeLensRefreshRequest": WorkspaceCodeLensRefreshRequest, - "WorkspaceCodeLensRefreshResponse": WorkspaceCodeLensRefreshResponse, - "WorkspaceConfigurationParams": WorkspaceConfigurationParams, - "WorkspaceConfigurationRequest": WorkspaceConfigurationRequest, - "WorkspaceConfigurationResponse": WorkspaceConfigurationResponse, - "WorkspaceDiagnosticParams": WorkspaceDiagnosticParams, - "WorkspaceDiagnosticRefreshRequest": WorkspaceDiagnosticRefreshRequest, - "WorkspaceDiagnosticRefreshResponse": WorkspaceDiagnosticRefreshResponse, - "WorkspaceDiagnosticReport": WorkspaceDiagnosticReport, - "WorkspaceDiagnosticReportPartialResult": WorkspaceDiagnosticReportPartialResult, - "WorkspaceDiagnosticRequest": WorkspaceDiagnosticRequest, - "WorkspaceDiagnosticResponse": WorkspaceDiagnosticResponse, - "WorkspaceDidChangeConfigurationNotification": WorkspaceDidChangeConfigurationNotification, - "WorkspaceDidChangeWatchedFilesNotification": WorkspaceDidChangeWatchedFilesNotification, - "WorkspaceDidChangeWorkspaceFoldersNotification": WorkspaceDidChangeWorkspaceFoldersNotification, - "WorkspaceDidCreateFilesNotification": WorkspaceDidCreateFilesNotification, - "WorkspaceDidDeleteFilesNotification": WorkspaceDidDeleteFilesNotification, - "WorkspaceDidRenameFilesNotification": WorkspaceDidRenameFilesNotification, - "WorkspaceDocumentDiagnosticReport": WorkspaceDocumentDiagnosticReport, - "WorkspaceEdit": WorkspaceEdit, - "WorkspaceEditClientCapabilities": WorkspaceEditClientCapabilities, - "WorkspaceExecuteCommandRequest": WorkspaceExecuteCommandRequest, - "WorkspaceExecuteCommandResponse": WorkspaceExecuteCommandResponse, - "WorkspaceFolder": WorkspaceFolder, - "WorkspaceFoldersChangeEvent": WorkspaceFoldersChangeEvent, - "WorkspaceFoldersInitializeParams": WorkspaceFoldersInitializeParams, - "WorkspaceFoldersServerCapabilities": WorkspaceFoldersServerCapabilities, - "WorkspaceFoldingRangeRefreshRequest": WorkspaceFoldingRangeRefreshRequest, - "WorkspaceFoldingRangeRefreshResponse": WorkspaceFoldingRangeRefreshResponse, - "WorkspaceFullDocumentDiagnosticReport": WorkspaceFullDocumentDiagnosticReport, - "WorkspaceInlayHintRefreshRequest": WorkspaceInlayHintRefreshRequest, - "WorkspaceInlayHintRefreshResponse": WorkspaceInlayHintRefreshResponse, - "WorkspaceInlineValueRefreshRequest": WorkspaceInlineValueRefreshRequest, - "WorkspaceInlineValueRefreshResponse": WorkspaceInlineValueRefreshResponse, - "WorkspaceOptions": WorkspaceOptions, - "WorkspaceSemanticTokensRefreshRequest": WorkspaceSemanticTokensRefreshRequest, - "WorkspaceSemanticTokensRefreshResponse": WorkspaceSemanticTokensRefreshResponse, - "WorkspaceSymbol": WorkspaceSymbol, - "WorkspaceSymbolClientCapabilities": WorkspaceSymbolClientCapabilities, - "WorkspaceSymbolOptions": WorkspaceSymbolOptions, - "WorkspaceSymbolParams": WorkspaceSymbolParams, - "WorkspaceSymbolRegistrationOptions": WorkspaceSymbolRegistrationOptions, - "WorkspaceSymbolRequest": WorkspaceSymbolRequest, - "WorkspaceSymbolResolveRequest": WorkspaceSymbolResolveRequest, - "WorkspaceSymbolResolveResponse": WorkspaceSymbolResolveResponse, - "WorkspaceSymbolResponse": WorkspaceSymbolResponse, - "WorkspaceUnchangedDocumentDiagnosticReport": WorkspaceUnchangedDocumentDiagnosticReport, - "WorkspaceWillCreateFilesRequest": WorkspaceWillCreateFilesRequest, - "WorkspaceWillCreateFilesResponse": WorkspaceWillCreateFilesResponse, - "WorkspaceWillDeleteFilesRequest": WorkspaceWillDeleteFilesRequest, - "WorkspaceWillDeleteFilesResponse": WorkspaceWillDeleteFilesResponse, - "WorkspaceWillRenameFilesRequest": WorkspaceWillRenameFilesRequest, - "WorkspaceWillRenameFilesResponse": WorkspaceWillRenameFilesResponse, - "WorkspaceWorkspaceFoldersRequest": WorkspaceWorkspaceFoldersRequest, - "WorkspaceWorkspaceFoldersResponse": WorkspaceWorkspaceFoldersResponse, - "_InitializeParams": _InitializeParams, -} - -_MESSAGE_DIRECTION: Dict[str, str] = { - # Request methods - CALL_HIERARCHY_INCOMING_CALLS: "clientToServer", - CALL_HIERARCHY_OUTGOING_CALLS: "clientToServer", - CLIENT_REGISTER_CAPABILITY: "serverToClient", - CLIENT_UNREGISTER_CAPABILITY: "serverToClient", - CODE_ACTION_RESOLVE: "clientToServer", - CODE_LENS_RESOLVE: "clientToServer", - COMPLETION_ITEM_RESOLVE: "clientToServer", - DOCUMENT_LINK_RESOLVE: "clientToServer", - INITIALIZE: "clientToServer", - INLAY_HINT_RESOLVE: "clientToServer", - SHUTDOWN: "clientToServer", - TEXT_DOCUMENT_CODE_ACTION: "clientToServer", - TEXT_DOCUMENT_CODE_LENS: "clientToServer", - TEXT_DOCUMENT_COLOR_PRESENTATION: "clientToServer", - TEXT_DOCUMENT_COMPLETION: "clientToServer", - TEXT_DOCUMENT_DECLARATION: "clientToServer", - TEXT_DOCUMENT_DEFINITION: "clientToServer", - TEXT_DOCUMENT_DIAGNOSTIC: "clientToServer", - TEXT_DOCUMENT_DOCUMENT_COLOR: "clientToServer", - TEXT_DOCUMENT_DOCUMENT_HIGHLIGHT: "clientToServer", - TEXT_DOCUMENT_DOCUMENT_LINK: "clientToServer", - TEXT_DOCUMENT_DOCUMENT_SYMBOL: "clientToServer", - TEXT_DOCUMENT_FOLDING_RANGE: "clientToServer", - TEXT_DOCUMENT_FORMATTING: "clientToServer", - TEXT_DOCUMENT_HOVER: "clientToServer", - TEXT_DOCUMENT_IMPLEMENTATION: "clientToServer", - TEXT_DOCUMENT_INLAY_HINT: "clientToServer", - TEXT_DOCUMENT_INLINE_COMPLETION: "clientToServer", - TEXT_DOCUMENT_INLINE_VALUE: "clientToServer", - TEXT_DOCUMENT_LINKED_EDITING_RANGE: "clientToServer", - TEXT_DOCUMENT_MONIKER: "clientToServer", - TEXT_DOCUMENT_ON_TYPE_FORMATTING: "clientToServer", - TEXT_DOCUMENT_PREPARE_CALL_HIERARCHY: "clientToServer", - TEXT_DOCUMENT_PREPARE_RENAME: "clientToServer", - TEXT_DOCUMENT_PREPARE_TYPE_HIERARCHY: "clientToServer", - TEXT_DOCUMENT_RANGES_FORMATTING: "clientToServer", - TEXT_DOCUMENT_RANGE_FORMATTING: "clientToServer", - TEXT_DOCUMENT_REFERENCES: "clientToServer", - TEXT_DOCUMENT_RENAME: "clientToServer", - TEXT_DOCUMENT_SELECTION_RANGE: "clientToServer", - TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL: "clientToServer", - TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL_DELTA: "clientToServer", - TEXT_DOCUMENT_SEMANTIC_TOKENS_RANGE: "clientToServer", - TEXT_DOCUMENT_SIGNATURE_HELP: "clientToServer", - TEXT_DOCUMENT_TYPE_DEFINITION: "clientToServer", - TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL: "clientToServer", - TYPE_HIERARCHY_SUBTYPES: "clientToServer", - TYPE_HIERARCHY_SUPERTYPES: "clientToServer", - WINDOW_SHOW_DOCUMENT: "serverToClient", - WINDOW_SHOW_MESSAGE_REQUEST: "serverToClient", - WINDOW_WORK_DONE_PROGRESS_CREATE: "serverToClient", - WORKSPACE_APPLY_EDIT: "serverToClient", - WORKSPACE_CODE_LENS_REFRESH: "serverToClient", - WORKSPACE_CONFIGURATION: "serverToClient", - WORKSPACE_DIAGNOSTIC: "clientToServer", - WORKSPACE_DIAGNOSTIC_REFRESH: "serverToClient", - WORKSPACE_EXECUTE_COMMAND: "clientToServer", - WORKSPACE_FOLDING_RANGE_REFRESH: "serverToClient", - WORKSPACE_INLAY_HINT_REFRESH: "serverToClient", - WORKSPACE_INLINE_VALUE_REFRESH: "serverToClient", - WORKSPACE_SEMANTIC_TOKENS_REFRESH: "serverToClient", - WORKSPACE_SYMBOL: "clientToServer", - WORKSPACE_SYMBOL_RESOLVE: "clientToServer", - WORKSPACE_WILL_CREATE_FILES: "clientToServer", - WORKSPACE_WILL_DELETE_FILES: "clientToServer", - WORKSPACE_WILL_RENAME_FILES: "clientToServer", - WORKSPACE_WORKSPACE_FOLDERS: "serverToClient", - # Notification methods - CANCEL_REQUEST: "both", - EXIT: "clientToServer", - INITIALIZED: "clientToServer", - LOG_TRACE: "serverToClient", - NOTEBOOK_DOCUMENT_DID_CHANGE: "clientToServer", - NOTEBOOK_DOCUMENT_DID_CLOSE: "clientToServer", - NOTEBOOK_DOCUMENT_DID_OPEN: "clientToServer", - NOTEBOOK_DOCUMENT_DID_SAVE: "clientToServer", - PROGRESS: "both", - SET_TRACE: "clientToServer", - TELEMETRY_EVENT: "serverToClient", - TEXT_DOCUMENT_DID_CHANGE: "clientToServer", - TEXT_DOCUMENT_DID_CLOSE: "clientToServer", - TEXT_DOCUMENT_DID_OPEN: "clientToServer", - TEXT_DOCUMENT_DID_SAVE: "clientToServer", - TEXT_DOCUMENT_PUBLISH_DIAGNOSTICS: "serverToClient", - TEXT_DOCUMENT_WILL_SAVE: "clientToServer", - WINDOW_LOG_MESSAGE: "serverToClient", - WINDOW_SHOW_MESSAGE: "serverToClient", - WINDOW_WORK_DONE_PROGRESS_CANCEL: "clientToServer", - WORKSPACE_DID_CHANGE_CONFIGURATION: "clientToServer", - WORKSPACE_DID_CHANGE_WATCHED_FILES: "clientToServer", - WORKSPACE_DID_CHANGE_WORKSPACE_FOLDERS: "clientToServer", - WORKSPACE_DID_CREATE_FILES: "clientToServer", - WORKSPACE_DID_DELETE_FILES: "clientToServer", - WORKSPACE_DID_RENAME_FILES: "clientToServer", -} - - -def message_direction(method: str) -> str: - """Returns message direction clientToServer, serverToClient or both.""" - return _MESSAGE_DIRECTION[method] From ebcacd8c6857431f96741fb51d534ea2f877e5ce Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 6 Nov 2023 13:37:42 -0800 Subject: [PATCH 10/27] make year check flexible for new releases --- .github/workflows/version_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/version_check.py b/.github/workflows/version_check.py index c9b3e54..eef52d8 100644 --- a/.github/workflows/version_check.py +++ b/.github/workflows/version_check.py @@ -20,8 +20,8 @@ version = line.split("=")[1].strip().strip('"') year, minor, micro = version.split(".") today = datetime.date.today() - if int(year) != today.year: - print(f"Version {version} year should be {today.year}") + if int(year) in [today.year, today.year + 1]: + print(f"Version {version} year should be {today.year} or {today.year + 1}") sys.exit(1) print("Version check passed") From 68f44e9da986017dec49c8d39aded6eeb0df7959 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 6 Nov 2023 13:38:09 -0800 Subject: [PATCH 11/27] Disable smoke tests since pygls does not have new names --- .github/workflows/pr-check.yml | 98 +++++++++++++++++----------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 312a6a3..54b78be 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -218,52 +218,52 @@ jobs: if-no-files-found: error retention-days: 7 - smoke-tests: - name: Smoke Tests (pygls) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python: ['3.8', '3.9', '3.10', '3.11', '3.12'] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Checkout Pygls - uses: actions/checkout@v4 - with: - repository: openlawlibrary/pygls - path: smoke_tests - - - name: Use Python ${{ matrix.python }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - - name: Update pip, install wheel - run: python -m pip install -U pip wheel - shell: bash - - - name: Install pip pygls dependencies - run: python -m pip install typeguard mock pytest pytest-asyncio - shell: bash - - - name: Install pip lsprotocol dependencies - run: python -m pip install -r ./packages/python/requirements.txt - shell: bash - - - name: Install pygls - run: python -m pip install --no-deps ./smoke_tests - shell: bash - - - name: Pip List - run: python -m pip list - shell: bash - - - name: Run Tests - run: python -m pytest smoke_tests/tests - env: - PYTHONPATH: ./packages/python - shell: bash + # smoke-tests: + # name: Smoke Tests (pygls) + # runs-on: ${{ matrix.os }} + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, windows-latest] + # python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + + # - name: Checkout Pygls + # uses: actions/checkout@v4 + # with: + # repository: openlawlibrary/pygls + # path: smoke_tests + + # - name: Use Python ${{ matrix.python }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python }} + + # - name: Update pip, install wheel + # run: python -m pip install -U pip wheel + # shell: bash + + # - name: Install pip pygls dependencies + # run: python -m pip install typeguard mock pytest pytest-asyncio + # shell: bash + + # - name: Install pip lsprotocol dependencies + # run: python -m pip install -r ./packages/python/requirements.txt + # shell: bash + + # - name: Install pygls + # run: python -m pip install --no-deps ./smoke_tests + # shell: bash + + # - name: Pip List + # run: python -m pip list + # shell: bash + + # - name: Run Tests + # run: python -m pytest smoke_tests/tests + # env: + # PYTHONPATH: ./packages/python + # shell: bash From de6233c10ea2ff4e269ce17708ad050c82d21660 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 6 Nov 2023 13:47:35 -0800 Subject: [PATCH 12/27] Fix linting --- .github/workflows/version_check.py | 2 +- packages/python/lsprotocol/_hooks.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/version_check.py b/.github/workflows/version_check.py index eef52d8..4679933 100644 --- a/.github/workflows/version_check.py +++ b/.github/workflows/version_check.py @@ -20,7 +20,7 @@ version = line.split("=")[1].strip().strip('"') year, minor, micro = version.split(".") today = datetime.date.today() - if int(year) in [today.year, today.year + 1]: + if int(year) not in [today.year, today.year + 1]: print(f"Version {version} year should be {today.year} or {today.year + 1}") sys.exit(1) diff --git a/packages/python/lsprotocol/_hooks.py b/packages/python/lsprotocol/_hooks.py index cd4477c..73efad5 100644 --- a/packages/python/lsprotocol/_hooks.py +++ b/packages/python/lsprotocol/_hooks.py @@ -1212,7 +1212,7 @@ def _omit(cls: type, prop: str) -> bool: special = lsp_types.is_special_property(cls, prop) return not special - def _with_custom_unstructure(cls: attrs.AttrsInstance) -> Any: + def _with_custom_unstructure(cls: type) -> Any: attributes = { a.name: cattrs.gen.override( rename=_to_camel_case(a.name), @@ -1222,7 +1222,7 @@ def _with_custom_unstructure(cls: attrs.AttrsInstance) -> Any: } return cattrs.gen.make_dict_unstructure_fn(cls, converter, **attributes) - def _with_custom_structure(cls: attrs.AttrsInstance) -> Any: + def _with_custom_structure(cls: type) -> Any: attributes = { a.name: cattrs.gen.override( rename=_to_camel_case(a.name), From fd3eb9470f59367364f0608bfaf332d6abdeb728 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 10:55:00 -0800 Subject: [PATCH 13/27] Fix rust code --- packages/rust/lsprotocol/src/lib.rs | 93 +++++++++++++++-------------- requirements.txt | 6 +- 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index 81af676..c4d36d9 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -5811,7 +5811,7 @@ pub struct ServerCapabilities { /// @since 3.15.0 /// @since 3.18.0 ServerInfo type name added. /// @proposed -#[cfg(feature = "proposed", since = "3.18.0 ServerInfo type name added.")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ServerInfo { @@ -6204,7 +6204,7 @@ pub struct CodeActionContext { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct CodeActionDisabled { @@ -6237,7 +6237,7 @@ pub struct CodeActionOptions { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct LocationUriOnly { @@ -6349,7 +6349,7 @@ pub struct RenameOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct PrepareRenamePlaceholder { @@ -6360,7 +6360,7 @@ pub struct PrepareRenamePlaceholder { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct PrepareRenameDefaultBehavior { @@ -6392,7 +6392,7 @@ pub struct SemanticTokensLegend { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct SemanticTokensFullDelta { @@ -6587,7 +6587,7 @@ pub struct NotebookCell { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentCellChanges { @@ -6623,7 +6623,7 @@ pub struct SelectedCompletionInfo { /// @since 3.15.0 /// @since 3.18.0 ClientInfo type name added. /// @proposed -#[cfg(feature = "proposed", since = "3.18.0 ClientInfo type name added.")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientInfo { @@ -6733,7 +6733,7 @@ pub struct NotebookDocumentSyncRegistrationOptions { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct WorkspaceOptions { @@ -6750,7 +6750,7 @@ pub struct WorkspaceOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentContentChangePartial { @@ -6769,7 +6769,7 @@ pub struct TextDocumentContentChangePartial { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentContentChangeWholeDocument { @@ -6804,7 +6804,7 @@ pub struct DiagnosticRelatedInformation { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct EditRangeWithInsertReplace { @@ -6815,7 +6815,7 @@ pub struct EditRangeWithInsertReplace { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ServerCompletionItemOptions { @@ -6831,6 +6831,7 @@ pub struct ServerCompletionItemOptions { /// @proposed /// @deprecated use MarkupContent instead. #[deprecated] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct MarkedStringWithLanguage { @@ -6906,7 +6907,7 @@ pub struct ExecutionSummary { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentCellChangeStructure { @@ -6924,7 +6925,7 @@ pub struct NotebookDocumentCellChangeStructure { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentCellContentChanges { @@ -7225,7 +7226,7 @@ pub struct GeneralClientCapabilities { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentFilterWithNotebook { @@ -7240,7 +7241,7 @@ pub struct NotebookDocumentFilterWithNotebook { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentFilterWithCells { @@ -7314,7 +7315,7 @@ pub struct RelativePattern { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentFilterLanguage { @@ -7332,7 +7333,7 @@ pub struct TextDocumentFilterLanguage { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentFilterScheme { @@ -7350,7 +7351,7 @@ pub struct TextDocumentFilterScheme { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentFilterPattern { @@ -8174,7 +8175,7 @@ pub struct ShowDocumentClientCapabilities { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct StaleRequestSupportOptions { @@ -8221,7 +8222,7 @@ pub struct MarkdownClientCapabilities { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookCellLanguage { @@ -8232,7 +8233,7 @@ pub struct NotebookCellLanguage { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentFilterNotebookType { @@ -8250,7 +8251,7 @@ pub struct NotebookDocumentFilterNotebookType { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentFilterScheme { @@ -8268,7 +8269,7 @@ pub struct NotebookDocumentFilterScheme { /// /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct NotebookDocumentFilterPattern { @@ -8284,7 +8285,7 @@ pub struct NotebookDocumentFilterPattern { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ChangeAnnotationsSupportOptions { @@ -8296,7 +8297,7 @@ pub struct ChangeAnnotationsSupportOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientSymbolKindOptions { @@ -8313,7 +8314,7 @@ pub struct ClientSymbolKindOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientSymbolTagOptions { @@ -8323,7 +8324,7 @@ pub struct ClientSymbolTagOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientSymbolResolveOptions { @@ -8334,7 +8335,7 @@ pub struct ClientSymbolResolveOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientCompletionItemOptions { @@ -8396,7 +8397,7 @@ pub struct ClientCompletionItemOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientCompletionItemOptionsKind { @@ -8431,7 +8432,7 @@ pub struct CompletionListCapabilities { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientSignatureInformationOptions { @@ -8451,7 +8452,7 @@ pub struct ClientSignatureInformationOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientCodeActionLiteralOptions { @@ -8462,7 +8463,7 @@ pub struct ClientCodeActionLiteralOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientCodeActionResolveOptions { @@ -8472,7 +8473,7 @@ pub struct ClientCodeActionResolveOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientFoldingRangeKindOptions { @@ -8485,7 +8486,7 @@ pub struct ClientFoldingRangeKindOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientFoldingRangeOptions { @@ -8498,7 +8499,7 @@ pub struct ClientFoldingRangeOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientDiagnosticsTagOptions { @@ -8508,7 +8509,7 @@ pub struct ClientDiagnosticsTagOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientSemanticTokensRequestOptions { @@ -8523,7 +8524,7 @@ pub struct ClientSemanticTokensRequestOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientInlayHintResolveOptions { @@ -8533,7 +8534,7 @@ pub struct ClientInlayHintResolveOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientShowMessageActionItemOptions { @@ -8545,7 +8546,7 @@ pub struct ClientShowMessageActionItemOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct CompletionItemTagOptions { @@ -8555,7 +8556,7 @@ pub struct CompletionItemTagOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientCompletionItemResolveOptions { @@ -8565,7 +8566,7 @@ pub struct ClientCompletionItemResolveOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientCompletionItemInsertTextModeOptions { @@ -8574,7 +8575,7 @@ pub struct ClientCompletionItemInsertTextModeOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientSignatureParameterInformationOptions { @@ -8587,7 +8588,7 @@ pub struct ClientSignatureParameterInformationOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientCodeActionKindOptions { @@ -8600,7 +8601,7 @@ pub struct ClientCodeActionKindOptions { /// @since 3.18.0 /// @proposed -#[cfg(feature = "proposed", since = "3.18.0")] +#[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ClientSemanticTokensRequestFullDelta { diff --git a/requirements.txt b/requirements.txt index 954f876..9b38690 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,9 +26,9 @@ exceptiongroup==1.1.3 \ # via # cattrs # pytest -importlib-resources==6.1.0 \ - --hash=sha256:9d48dcccc213325e810fd723e7fbb45ccb39f6cf5c31f00cf2b965f5f10f3cb9 \ - --hash=sha256:aa50258bbfa56d4e33fbd8aa3ef48ded10d1735f11532b8df95388cc6bdb7e83 +importlib-resources==6.1.1 \ + --hash=sha256:3893a00122eafde6894c59914446a512f728a0c1a45f9bb9b63721b6bacf0b4a \ + --hash=sha256:e8bf90d8213b486f428c9c39714b920041cb02c184686a3dee24905aaa8105d6 # via # -r ./requirements.in # jsonschema From 0650b7a09fb6f7f767065545858c7667d385975e Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 14:26:46 -0800 Subject: [PATCH 14/27] More rust fixes --- generator/plugins/rust/rust_commons.py | 5 +- generator/plugins/rust/rust_constants.py | 2 - generator/plugins/rust/rust_structs.py | 7 + generator/plugins/rust/rust_tests.py | 18 +- packages/rust/lsprotocol/src/lib.rs | 1070 +++++++++++----------- tests/rust/src/main.rs | 25 +- 6 files changed, 576 insertions(+), 551 deletions(-) delete mode 100644 generator/plugins/rust/rust_constants.py diff --git a/generator/plugins/rust/rust_commons.py b/generator/plugins/rust/rust_commons.py index 4e228d5..b7cd798 100644 --- a/generator/plugins/rust/rust_commons.py +++ b/generator/plugins/rust/rust_commons.py @@ -324,7 +324,7 @@ def generate_extra_types(spec: model.LSPModel, type_data: TypeData) -> None: ), ) - direction = set([m.messageDirection for m in (spec.requests + spec.notifications)]) + direction = sorted(set([m.messageDirection for m in (spec.requests + spec.notifications)])) type_data.add_type_info( model.ReferenceType(kind="reference", name="MessageDirection"), "MessageDirection", @@ -461,7 +461,6 @@ def get_type_name( f"OR type with more than out of range count of subtypes: {type_def}" ) optional = optional or is_special(type_def) - print(f"Option<{name}>" if optional else name) elif type_def.kind == "literal": name = generate_literal_struct_type(type_def, types, spec, name_context) elif type_def.kind == "stringLiteral": @@ -611,7 +610,7 @@ def struct_wrapper( + generate_extras(type_def) + [ "#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)]", - '#[serde(rename_all = "camelCase")]', + '#[serde(rename_all = "camelCase", deny_unknown_fields)]', f"pub struct {name}", "{", ] diff --git a/generator/plugins/rust/rust_constants.py b/generator/plugins/rust/rust_constants.py deleted file mode 100644 index 5b7f7a9..0000000 --- a/generator/plugins/rust/rust_constants.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. diff --git a/generator/plugins/rust/rust_structs.py b/generator/plugins/rust/rust_structs.py index 4481c88..0c5d231 100644 --- a/generator/plugins/rust/rust_structs.py +++ b/generator/plugins/rust/rust_structs.py @@ -314,6 +314,13 @@ def generate_notification( type=notification_def.params, ) ] + else: + properties += [ + model.Property( + name="params", + type=model.ReferenceType(kind="reference", name="LSPNull"), + ) + ] inner = [] for prop_def in properties: diff --git a/generator/plugins/rust/rust_tests.py b/generator/plugins/rust/rust_tests.py index ced150a..5743f2f 100644 --- a/generator/plugins/rust/rust_tests.py +++ b/generator/plugins/rust/rust_tests.py @@ -27,7 +27,17 @@ def generate_test_code(spec: model.LSPModel, test_path: pathlib.Path) -> str: "}", ] - tests = "\n".join(lines) - code = test_path.read_text(encoding="utf-8") - code = code.replace("/*@@_LSP_GENERATED_TESTS_@@*/", tests) - test_path.write_text(code, encoding="utf-8") + + code = test_path.read_text(encoding="utf-8").splitlines() + start_marker = "GENERATED_TEST_CODE:start" + end_marker = "GENERATED_TEST_CODE:end" + + start_index = -1 + end_index = -1 + for i, line in enumerate(code): + if line.endswith(start_marker): + start_index = i+1 + elif line.endswith(end_marker): + end_index = i + code[start_index:end_index] = lines + test_path.write_text("\n".join(code), encoding="utf-8") diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index c4d36d9..30e0996 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -334,12 +334,12 @@ pub enum LSPNotificationMethods { #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] pub enum MessageDirection { + #[serde(rename = "both")] + Both, #[serde(rename = "clientToServer")] ClientToServer, #[serde(rename = "serverToClient")] ServerToClient, - #[serde(rename = "both")] - Both, } /// A set of predefined token types. This set is not fixed @@ -2036,7 +2036,7 @@ pub enum NotebookDocumentFilter { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ImplementationParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2055,7 +2055,7 @@ pub struct ImplementationParams { /// Represents a location inside a resource, such as a line /// inside a text file. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Location { pub range: Range, @@ -2063,7 +2063,7 @@ pub struct Location { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ImplementationRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2076,7 +2076,7 @@ pub struct ImplementationRegistrationOptions { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeDefinitionParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2093,7 +2093,7 @@ pub struct TypeDefinitionParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeDefinitionRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2107,7 +2107,7 @@ pub struct TypeDefinitionRegistrationOptions { /// A workspace folder inside a client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFolder { /// The name of the workspace folder. Used to refer to this /// workspace folder in the user interface. @@ -2119,7 +2119,7 @@ pub struct WorkspaceFolder { /// The parameters of a `workspace/didChangeWorkspaceFolders` notification. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeWorkspaceFoldersParams { /// The actual workspace folder change event. pub event: WorkspaceFoldersChangeEvent, @@ -2127,14 +2127,14 @@ pub struct DidChangeWorkspaceFoldersParams { /// The parameters of a configuration request. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ConfigurationParams { pub items: Vec, } /// Parameters for a [DocumentColorRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentColorParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2149,7 +2149,7 @@ pub struct DocumentColorParams { /// Represents a color range from a document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ColorInformation { /// The actual color value for this color range. pub color: Color, @@ -2159,7 +2159,7 @@ pub struct ColorInformation { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentColorRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2173,7 +2173,7 @@ pub struct DocumentColorRegistrationOptions { /// Parameters for a [ColorPresentationRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ColorPresentationParams { /// The color to request presentations for. pub color: Color, @@ -2193,7 +2193,7 @@ pub struct ColorPresentationParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ColorPresentation { /// An optional array of additional [text edits][TextEdit] that are applied when /// selecting this color presentation. Edits must not overlap with the main [edit][`ColorPresentation::textEdit`] nor with themselves. @@ -2211,14 +2211,14 @@ pub struct ColorPresentation { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkDoneProgressOptions { pub work_done_progress: Option, } /// General text document registration options. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2228,7 +2228,7 @@ pub struct TextDocumentRegistrationOptions { /// Parameters for a [FoldingRangeRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FoldingRangeParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2244,7 +2244,7 @@ pub struct FoldingRangeParams { /// Represents a folding range. To be valid, start and end line must be bigger than zero and smaller /// than the number of lines in the document. Clients are free to ignore invalid ranges. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FoldingRange { /// The text that the client should show when the specified range is /// collapsed. If not defined or not supported by the client, a default @@ -2274,7 +2274,7 @@ pub struct FoldingRange { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FoldingRangeRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2287,7 +2287,7 @@ pub struct FoldingRangeRegistrationOptions { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DeclarationParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2304,7 +2304,7 @@ pub struct DeclarationParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DeclarationRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2318,7 +2318,7 @@ pub struct DeclarationRegistrationOptions { /// A parameter literal used in selection range requests. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SelectionRangeParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2335,7 +2335,7 @@ pub struct SelectionRangeParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SelectionRangeRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2348,14 +2348,14 @@ pub struct SelectionRangeRegistrationOptions { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkDoneProgressCreateParams { /// The token to be used to report progress. pub token: ProgressToken, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkDoneProgressCancelParams { /// The token to be used to report progress. pub token: ProgressToken, @@ -2365,7 +2365,7 @@ pub struct WorkDoneProgressCancelParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyPrepareParams { /// The position inside the text document. pub position: Position, @@ -2382,7 +2382,7 @@ pub struct CallHierarchyPrepareParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyItem { /// A data entry field that is preserved between a call hierarchy prepare and /// incoming calls or outgoing calls requests. @@ -2415,7 +2415,7 @@ pub struct CallHierarchyItem { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2431,7 +2431,7 @@ pub struct CallHierarchyRegistrationOptions { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyIncomingCallsParams { pub item: CallHierarchyItem, @@ -2447,7 +2447,7 @@ pub struct CallHierarchyIncomingCallsParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyIncomingCall { /// The item that makes the call. pub from: CallHierarchyItem, @@ -2461,7 +2461,7 @@ pub struct CallHierarchyIncomingCall { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyOutgoingCallsParams { pub item: CallHierarchyItem, @@ -2477,7 +2477,7 @@ pub struct CallHierarchyOutgoingCallsParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyOutgoingCall { /// The range at which this item is called. This is the range relative to the caller, e.g the item /// passed to [`provideCallHierarchyOutgoingCalls`][`CallHierarchyItemProvider::provideCallHierarchyOutgoingCalls`] @@ -2490,7 +2490,7 @@ pub struct CallHierarchyOutgoingCall { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2505,7 +2505,7 @@ pub struct SemanticTokensParams { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokens { /// The actual tokens. pub data: Vec, @@ -2519,14 +2519,14 @@ pub struct SemanticTokens { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensPartialResult { pub data: Vec, } /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2550,7 +2550,7 @@ pub struct SemanticTokensRegistrationOptions { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensDeltaParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2569,7 +2569,7 @@ pub struct SemanticTokensDeltaParams { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensDelta { /// The semantic token edits to transform a previous result into a new result. pub edits: Vec, @@ -2579,14 +2579,14 @@ pub struct SemanticTokensDelta { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensDeltaPartialResult { pub edits: Vec, } /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensRangeParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2606,7 +2606,7 @@ pub struct SemanticTokensRangeParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShowDocumentParams { /// Indicates to show the resource in an external program. /// To show, for example, `https://code.visualstudio.com/` @@ -2633,14 +2633,14 @@ pub struct ShowDocumentParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShowDocumentResult { /// A boolean indicating if the show was successful. pub success: bool, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LinkedEditingRangeParams { /// The position inside the text document. pub position: Position, @@ -2656,7 +2656,7 @@ pub struct LinkedEditingRangeParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LinkedEditingRanges { /// A list of ranges that can be edited together. The ranges must have /// identical length and contain identical text content. The ranges cannot overlap. @@ -2669,7 +2669,7 @@ pub struct LinkedEditingRanges { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LinkedEditingRangeRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2686,7 +2686,7 @@ pub struct LinkedEditingRangeRegistrationOptions { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CreateFilesParams { /// An array of all files/folders created in this operation. pub files: Vec, @@ -2705,7 +2705,7 @@ pub struct CreateFilesParams { /// cause failure of the operation. How the client recovers from the failure is described by /// the client capability: `workspace.workspaceEdit.failureHandling` #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceEdit { /// A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and /// delete file / folder operations. @@ -2735,7 +2735,7 @@ pub struct WorkspaceEdit { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileOperationRegistrationOptions { /// The actual filters. pub filters: Vec, @@ -2746,7 +2746,7 @@ pub struct FileOperationRegistrationOptions { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RenameFilesParams { /// An array of all files/folders renamed in this operation. When a folder is renamed, only /// the folder will be included, and not its children. @@ -2758,14 +2758,14 @@ pub struct RenameFilesParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DeleteFilesParams { /// An array of all files/folders deleted in this operation. pub files: Vec, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MonikerParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -2785,7 +2785,7 @@ pub struct MonikerParams { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Moniker { /// The identifier of the moniker. The value is opaque in LSIF however /// schema owners are allowed to define the structure if they want. @@ -2802,7 +2802,7 @@ pub struct Moniker { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MonikerRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2814,7 +2814,7 @@ pub struct MonikerRegistrationOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchyPrepareParams { /// The position inside the text document. pub position: Position, @@ -2828,7 +2828,7 @@ pub struct TypeHierarchyPrepareParams { /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchyItem { /// A data entry field that is preserved between a type hierarchy prepare and /// supertypes or subtypes requests. It could also be used to identify the @@ -2865,7 +2865,7 @@ pub struct TypeHierarchyItem { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchyRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2881,7 +2881,7 @@ pub struct TypeHierarchyRegistrationOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchySupertypesParams { pub item: TypeHierarchyItem, @@ -2897,7 +2897,7 @@ pub struct TypeHierarchySupertypesParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchySubtypesParams { pub item: TypeHierarchyItem, @@ -2913,7 +2913,7 @@ pub struct TypeHierarchySubtypesParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueParams { /// Additional information about the context in which inline values were /// requested. @@ -2933,7 +2933,7 @@ pub struct InlineValueParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -2949,7 +2949,7 @@ pub struct InlineValueRegistrationOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintParams { /// The document range for which inlay hints should be computed. pub range: Range, @@ -2965,7 +2965,7 @@ pub struct InlayHintParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHint { /// A data entry field that is preserved on an inlay hint between /// a `textDocument/inlayHint` and a `inlayHint/resolve` request. @@ -3013,7 +3013,7 @@ pub struct InlayHint { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3033,7 +3033,7 @@ pub struct InlayHintRegistrationOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentDiagnosticParams { /// The additional identifier provided during registration. pub identifier: Option, @@ -3056,7 +3056,7 @@ pub struct DocumentDiagnosticParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentDiagnosticReportPartialResult { pub related_documents: HashMap>, @@ -3066,7 +3066,7 @@ pub struct DocumentDiagnosticReportPartialResult { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DiagnosticServerCancellationData { pub retrigger_request: bool, } @@ -3075,7 +3075,7 @@ pub struct DiagnosticServerCancellationData { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DiagnosticRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3104,7 +3104,7 @@ pub struct DiagnosticRegistrationOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDiagnosticParams { /// The additional identifier provided during registration. pub identifier: Option, @@ -3125,7 +3125,7 @@ pub struct WorkspaceDiagnosticParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDiagnosticReport { pub items: Vec, } @@ -3134,7 +3134,7 @@ pub struct WorkspaceDiagnosticReport { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDiagnosticReportPartialResult { pub items: Vec, } @@ -3143,7 +3143,7 @@ pub struct WorkspaceDiagnosticReportPartialResult { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidOpenNotebookDocumentParams { /// The text documents that represent the content /// of a notebook cell. @@ -3157,7 +3157,7 @@ pub struct DidOpenNotebookDocumentParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeNotebookDocumentParams { /// The actual changes to the notebook document. /// @@ -3185,7 +3185,7 @@ pub struct DidChangeNotebookDocumentParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidSaveNotebookDocumentParams { /// The notebook document that got saved. pub notebook_document: NotebookDocumentIdentifier, @@ -3195,7 +3195,7 @@ pub struct DidSaveNotebookDocumentParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidCloseNotebookDocumentParams { /// The text documents that represent the content /// of a notebook cell that got closed. @@ -3211,7 +3211,7 @@ pub struct DidCloseNotebookDocumentParams { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineCompletionParams { /// Additional information about the context in which inline completions were /// requested. @@ -3233,7 +3233,7 @@ pub struct InlineCompletionParams { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineCompletionList { /// The inline completion items pub items: Vec, @@ -3245,7 +3245,7 @@ pub struct InlineCompletionList { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineCompletionItem { /// An optional [Command] that is executed *after* inserting this completion. pub command: Option, @@ -3266,7 +3266,7 @@ pub struct InlineCompletionItem { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineCompletionRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3279,19 +3279,19 @@ pub struct InlineCompletionRegistrationOptions { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RegistrationParams { pub registrations: Vec, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct UnregistrationParams { pub unregisterations: Vec, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InitializeParams { /// The capabilities provided by the client (editor or tool) pub capabilities: ClientCapabilities, @@ -3353,7 +3353,7 @@ pub struct InitializeParams { /// The result returned from an initialize request. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InitializeResult { /// The capabilities the language server provides. pub capabilities: ServerCapabilities, @@ -3367,7 +3367,7 @@ pub struct InitializeResult { /// The data type of the ResponseError if the /// initialize request fails. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InitializeError { /// Indicates whether the client execute the following retry logic: /// (1) show the message provided by the ResponseError to the user @@ -3377,26 +3377,26 @@ pub struct InitializeError { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InitializedParams {} /// The parameters of a change configuration notification. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeConfigurationParams { /// The actual changed settings pub settings: LSPAny, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeConfigurationRegistrationOptions { pub section: Option>>, } /// The parameters of a notification message. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShowMessageParams { /// The actual message. pub message: String, @@ -3407,7 +3407,7 @@ pub struct ShowMessageParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShowMessageRequestParams { /// The message action items to present. pub actions: Option>, @@ -3421,7 +3421,7 @@ pub struct ShowMessageRequestParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MessageActionItem { /// A short title like 'Retry', 'Open Log' etc. pub title: String, @@ -3429,7 +3429,7 @@ pub struct MessageActionItem { /// The log message parameters. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LogMessageParams { /// The actual message. pub message: String, @@ -3441,7 +3441,7 @@ pub struct LogMessageParams { /// The parameters sent in an open text document notification #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidOpenTextDocumentParams { /// The document that was opened. pub text_document: TextDocumentItem, @@ -3449,7 +3449,7 @@ pub struct DidOpenTextDocumentParams { /// The change text document notification's parameters. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeTextDocumentParams { /// The actual content changes. The content changes describe single state changes /// to the document. So if there are two content changes c1 (at array index 0) and @@ -3472,7 +3472,7 @@ pub struct DidChangeTextDocumentParams { /// Describe options to be used when registered for text document change events. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentChangeRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3485,7 +3485,7 @@ pub struct TextDocumentChangeRegistrationOptions { /// The parameters sent in a close text document notification #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidCloseTextDocumentParams { /// The document that was closed. pub text_document: TextDocumentIdentifier, @@ -3493,7 +3493,7 @@ pub struct DidCloseTextDocumentParams { /// The parameters sent in a save text document notification #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidSaveTextDocumentParams { /// Optional the content when saved. Depends on the includeText value /// when the save notification was requested. @@ -3505,7 +3505,7 @@ pub struct DidSaveTextDocumentParams { /// Save registration options. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSaveRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3518,7 +3518,7 @@ pub struct TextDocumentSaveRegistrationOptions { /// The parameters sent in a will save text document notification. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WillSaveTextDocumentParams { /// The 'TextDocumentSaveReason'. pub reason: TextDocumentSaveReason, @@ -3529,7 +3529,7 @@ pub struct WillSaveTextDocumentParams { /// A text edit applicable to a text document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextEdit { /// The string to be inserted. For delete operations use an /// empty string. @@ -3542,7 +3542,7 @@ pub struct TextEdit { /// The watched files change notification's parameters. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeWatchedFilesParams { /// The actual file events. pub changes: Vec, @@ -3550,7 +3550,7 @@ pub struct DidChangeWatchedFilesParams { /// Describe options to be used when registered for text document change events. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeWatchedFilesRegistrationOptions { /// The watchers to register. pub watchers: Vec, @@ -3558,7 +3558,7 @@ pub struct DidChangeWatchedFilesRegistrationOptions { /// The publish diagnostic notification's parameters. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PublishDiagnosticsParams { /// An array of diagnostic information items. pub diagnostics: Vec, @@ -3574,7 +3574,7 @@ pub struct PublishDiagnosticsParams { /// Completion parameters #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionParams { /// The completion context. This is only available it the client specifies /// to send this using the client capability `textDocument.completion.contextSupport === true` @@ -3597,7 +3597,7 @@ pub struct CompletionParams { /// A completion item represents a text snippet that is /// proposed to complete text that is being typed. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionItem { /// An optional array of additional [text edits][TextEdit] that are applied when /// selecting this completion. Edits must not overlap (including the same insert position) @@ -3740,7 +3740,7 @@ pub struct CompletionItem { /// Represents a collection of [completion items][CompletionItem] to be presented /// in the editor. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionList { /// This list it not complete. Further typing results in recomputing this list. /// @@ -3769,7 +3769,7 @@ pub struct CompletionList { /// Registration options for a [CompletionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionRegistrationOptions { /// The list of all possible characters that commit a completion. This field can be used /// if clients don't support individual commit characters per completion item. See @@ -3809,7 +3809,7 @@ pub struct CompletionRegistrationOptions { /// Parameters for a [HoverRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct HoverParams { /// The position inside the text document. pub position: Position, @@ -3823,7 +3823,7 @@ pub struct HoverParams { /// The result of a hover request. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Hover { /// The hover's content pub contents: OR3>, @@ -3835,7 +3835,7 @@ pub struct Hover { /// Registration options for a [HoverRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct HoverRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3845,7 +3845,7 @@ pub struct HoverRegistrationOptions { /// Parameters for a [SignatureHelpRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureHelpParams { /// The signature help context. This is only available if the client specifies /// to send this using the client capability `textDocument.signatureHelp.contextSupport === true` @@ -3867,7 +3867,7 @@ pub struct SignatureHelpParams { /// callable. There can be multiple signature but only one /// active and only one active parameter. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureHelp { /// The active parameter of the active signature. If omitted or the value /// lies outside the range of `signatures[activeSignature].parameters` @@ -3895,7 +3895,7 @@ pub struct SignatureHelp { /// Registration options for a [SignatureHelpRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureHelpRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3916,7 +3916,7 @@ pub struct SignatureHelpRegistrationOptions { /// Parameters for a [DefinitionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DefinitionParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -3934,7 +3934,7 @@ pub struct DefinitionParams { /// Registration options for a [DefinitionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DefinitionRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3944,7 +3944,7 @@ pub struct DefinitionRegistrationOptions { /// Parameters for a [ReferencesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ReferenceParams { pub context: ReferenceContext, @@ -3964,7 +3964,7 @@ pub struct ReferenceParams { /// Registration options for a [ReferencesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ReferenceRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -3974,7 +3974,7 @@ pub struct ReferenceRegistrationOptions { /// Parameters for a [DocumentHighlightRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentHighlightParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -3994,7 +3994,7 @@ pub struct DocumentHighlightParams { /// special attention. Usually a document highlight is visualized by changing /// the background color of its range. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentHighlight { /// The highlight kind, default is [text][`DocumentHighlightKind::Text`]. pub kind: Option, @@ -4005,7 +4005,7 @@ pub struct DocumentHighlight { /// Registration options for a [DocumentHighlightRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentHighlightRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4015,7 +4015,7 @@ pub struct DocumentHighlightRegistrationOptions { /// Parameters for a [DocumentSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentSymbolParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -4031,7 +4031,7 @@ pub struct DocumentSymbolParams { /// Represents information about programming constructs like variables, classes, /// interfaces etc. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SymbolInformation { /// The name of the symbol containing this symbol. This information is for /// user interface purposes (e.g. to render a qualifier in the user interface @@ -4073,7 +4073,7 @@ pub struct SymbolInformation { /// have two ranges: one that encloses its definition and one that points to /// its most interesting range, e.g. the range of an identifier. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentSymbol { /// Children of this symbol, e.g. properties of a class. pub children: Option>, @@ -4111,7 +4111,7 @@ pub struct DocumentSymbol { /// Registration options for a [DocumentSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentSymbolRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4127,7 +4127,7 @@ pub struct DocumentSymbolRegistrationOptions { /// The parameters of a [CodeActionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionParams { /// Context carrying additional information. pub context: CodeActionContext, @@ -4151,7 +4151,7 @@ pub struct CodeActionParams { /// an array of arguments which will be passed to the command handler /// function when invoked. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Command { /// Arguments that the command handler should be /// invoked with. @@ -4169,7 +4169,7 @@ pub struct Command { /// /// A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeAction { /// A command this code action executes. If a code action /// provides an edit and a command, first the edit is @@ -4225,7 +4225,7 @@ pub struct CodeAction { /// Registration options for a [CodeActionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionRegistrationOptions { /// CodeActionKinds that this server may return. /// @@ -4247,7 +4247,7 @@ pub struct CodeActionRegistrationOptions { /// The parameters of a [WorkspaceSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -4267,7 +4267,7 @@ pub struct WorkspaceSymbolParams { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbol { /// The name of the symbol containing this symbol. This information is for /// user interface purposes (e.g. to render a qualifier in the user interface @@ -4300,7 +4300,7 @@ pub struct WorkspaceSymbol { /// Registration options for a [WorkspaceSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolRegistrationOptions { /// The server provides support to resolve additional /// information for a workspace symbol. @@ -4311,7 +4311,7 @@ pub struct WorkspaceSymbolRegistrationOptions { /// The parameters of a [CodeLensRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLensParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -4330,7 +4330,7 @@ pub struct CodeLensParams { /// A code lens is _unresolved_ when no command is associated to it. For performance /// reasons the creation of a code lens and resolving should be done in two stages. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLens { /// The command this code lens represents. pub command: Option, @@ -4345,7 +4345,7 @@ pub struct CodeLens { /// Registration options for a [CodeLensRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLensRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4358,7 +4358,7 @@ pub struct CodeLensRegistrationOptions { /// The parameters of a [DocumentLinkRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentLinkParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -4374,7 +4374,7 @@ pub struct DocumentLinkParams { /// A document link is a range in a text document that links to an internal or external resource, like another /// text document or a web site. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentLink { /// A data entry field that is preserved on a document link between a /// DocumentLinkRequest and a DocumentLinkResolveRequest. @@ -4398,7 +4398,7 @@ pub struct DocumentLink { /// Registration options for a [DocumentLinkRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentLinkRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4411,7 +4411,7 @@ pub struct DocumentLinkRegistrationOptions { /// The parameters of a [DocumentFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentFormattingParams { /// The format options. pub options: FormattingOptions, @@ -4425,7 +4425,7 @@ pub struct DocumentFormattingParams { /// Registration options for a [DocumentFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentFormattingRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4435,7 +4435,7 @@ pub struct DocumentFormattingRegistrationOptions { /// The parameters of a [DocumentRangeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentRangeFormattingParams { /// The format options pub options: FormattingOptions, @@ -4452,7 +4452,7 @@ pub struct DocumentRangeFormattingParams { /// Registration options for a [DocumentRangeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentRangeFormattingRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4473,7 +4473,7 @@ pub struct DocumentRangeFormattingRegistrationOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentRangesFormattingParams { /// The format options pub options: FormattingOptions, @@ -4490,7 +4490,7 @@ pub struct DocumentRangesFormattingParams { /// The parameters of a [DocumentOnTypeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentOnTypeFormattingParams { /// The character that has been typed that triggered the formatting /// on type request. That is not necessarily the last character that @@ -4512,7 +4512,7 @@ pub struct DocumentOnTypeFormattingParams { /// Registration options for a [DocumentOnTypeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentOnTypeFormattingRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4528,7 +4528,7 @@ pub struct DocumentOnTypeFormattingRegistrationOptions { /// The parameters of a [RenameRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RenameParams { /// The new name of the symbol. If the given name is not valid the /// request must return a [ResponseError] with an @@ -4547,7 +4547,7 @@ pub struct RenameParams { /// Registration options for a [RenameRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RenameRegistrationOptions { /// A document selector to identify the scope of the registration. If set to null /// the document selector provided on the client side will be used. @@ -4561,7 +4561,7 @@ pub struct RenameRegistrationOptions { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PrepareRenameParams { /// The position inside the text document. pub position: Position, @@ -4575,7 +4575,7 @@ pub struct PrepareRenameParams { /// The parameters of a [ExecuteCommandRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ExecuteCommandParams { /// Arguments that the command should be invoked with. pub arguments: Option>, @@ -4589,7 +4589,7 @@ pub struct ExecuteCommandParams { /// Registration options for a [ExecuteCommandRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ExecuteCommandRegistrationOptions { /// The commands to be executed on the server pub commands: Vec, @@ -4597,7 +4597,7 @@ pub struct ExecuteCommandRegistrationOptions { /// The parameters passed via an apply workspace edit request. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ApplyWorkspaceEditParams { /// The edits to apply. pub edit: WorkspaceEdit, @@ -4612,7 +4612,7 @@ pub struct ApplyWorkspaceEditParams { /// /// @since 3.17 renamed from ApplyWorkspaceEditResponse #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ApplyWorkspaceEditResult { /// Indicates whether the edit was applied or not. pub applied: bool, @@ -4629,7 +4629,7 @@ pub struct ApplyWorkspaceEditResult { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkDoneProgressBegin { /// Controls if a cancel button should show to allow the user to cancel the /// long running operation. Clients that don't support cancellation are allowed @@ -4661,7 +4661,7 @@ pub struct WorkDoneProgressBegin { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkDoneProgressReport { /// Controls enablement state of a cancel button. /// @@ -4688,7 +4688,7 @@ pub struct WorkDoneProgressReport { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkDoneProgressEnd { pub kind: String, @@ -4698,13 +4698,13 @@ pub struct WorkDoneProgressEnd { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SetTraceParams { pub value: TraceValues, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LogTraceParams { pub message: String, @@ -4712,14 +4712,14 @@ pub struct LogTraceParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CancelParams { /// The request id to cancel. pub id: OR2, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ProgressParams { /// The progress token provided by the client or server. pub token: ProgressToken, @@ -4731,7 +4731,7 @@ pub struct ProgressParams { /// A parameter literal used in requests to pass a text document and a position inside that /// document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPositionParams { /// The position inside the text document. pub position: Position, @@ -4741,14 +4741,14 @@ pub struct TextDocumentPositionParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkDoneProgressParams { /// An optional token that a server can use to report work done progress. pub work_done_token: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PartialResultParams { /// An optional token that a server can use to report partial results (e.g. streaming) to /// the client. @@ -4758,7 +4758,7 @@ pub struct PartialResultParams { /// Represents the connection of two locations. Provides additional metadata over normal [locations][Location], /// including an origin range. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LocationLink { /// Span of the origin of this link. /// @@ -4791,7 +4791,7 @@ pub struct LocationLink { /// } /// ``` #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Range { /// The range's end position. pub end: Position, @@ -4801,7 +4801,7 @@ pub struct Range { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ImplementationOptions { pub work_done_progress: Option, } @@ -4809,7 +4809,7 @@ pub struct ImplementationOptions { /// Static registration options to be returned in the initialize /// request. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct StaticRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. @@ -4817,14 +4817,14 @@ pub struct StaticRegistrationOptions { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeDefinitionOptions { pub work_done_progress: Option, } /// The workspace folder change event. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFoldersChangeEvent { /// The array of added workspace folders pub added: Vec, @@ -4834,7 +4834,7 @@ pub struct WorkspaceFoldersChangeEvent { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ConfigurationItem { /// The scope to get the configuration section for. pub scope_uri: Option, @@ -4845,7 +4845,7 @@ pub struct ConfigurationItem { /// A literal to identify a text document in the client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentIdentifier { /// The text document's uri. pub uri: String, @@ -4853,7 +4853,7 @@ pub struct TextDocumentIdentifier { /// Represents a color in RGBA space. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Color { /// The alpha component of this color in the range [0-1]. pub alpha: Decimal, @@ -4869,19 +4869,19 @@ pub struct Color { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentColorOptions { pub work_done_progress: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FoldingRangeOptions { pub work_done_progress: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DeclarationOptions { pub work_done_progress: Option, } @@ -4914,7 +4914,7 @@ pub struct DeclarationOptions { /// /// @since 3.17.0 - support for negotiated position encoding. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Position { /// Character offset on a line in a document (zero-based). /// @@ -4933,7 +4933,7 @@ pub struct Position { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SelectionRangeOptions { pub work_done_progress: Option, } @@ -4942,14 +4942,14 @@ pub struct SelectionRangeOptions { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyOptions { pub work_done_progress: Option, } /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensOptions { /// Server supports providing semantic tokens for a full document. pub full: Option>, @@ -4966,7 +4966,7 @@ pub struct SemanticTokensOptions { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensEdit { /// The elements to insert. pub data: Option>, @@ -4979,7 +4979,7 @@ pub struct SemanticTokensEdit { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LinkedEditingRangeOptions { pub work_done_progress: Option, } @@ -4988,7 +4988,7 @@ pub struct LinkedEditingRangeOptions { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileCreate { /// A file:// URI for the location of the file/folder being created. pub uri: String, @@ -4999,7 +4999,7 @@ pub struct FileCreate { /// So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any /// kind of ordering. However the edits must be non overlapping. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentEdit { /// The edits to be applied. /// @@ -5013,7 +5013,7 @@ pub struct TextDocumentEdit { /// Create file operation. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CreateFile { /// An optional annotation identifier describing the operation. /// @@ -5032,7 +5032,7 @@ pub struct CreateFile { /// Rename file operation #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RenameFile { /// An optional annotation identifier describing the operation. /// @@ -5054,7 +5054,7 @@ pub struct RenameFile { /// Delete file operation #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DeleteFile { /// An optional annotation identifier describing the operation. /// @@ -5075,7 +5075,7 @@ pub struct DeleteFile { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ChangeAnnotation { /// A human-readable string which is rendered less prominent in /// the user interface. @@ -5095,7 +5095,7 @@ pub struct ChangeAnnotation { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileOperationFilter { /// The actual file operation pattern. pub pattern: FileOperationPattern, @@ -5108,7 +5108,7 @@ pub struct FileOperationFilter { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileRename { /// A file:// URI for the new location of the file/folder being renamed. pub new_uri: String, @@ -5121,14 +5121,14 @@ pub struct FileRename { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileDelete { /// A file:// URI for the location of the file/folder being deleted. pub uri: String, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MonikerOptions { pub work_done_progress: Option, } @@ -5137,14 +5137,14 @@ pub struct MonikerOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchyOptions { pub work_done_progress: Option, } /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueContext { /// The stack frame (as a DAP Id) where the execution has stopped. pub frame_id: i32, @@ -5158,7 +5158,7 @@ pub struct InlineValueContext { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueText { /// The document range for which the inline value applies. pub range: Range, @@ -5173,7 +5173,7 @@ pub struct InlineValueText { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueVariableLookup { /// How to perform the lookup. pub case_sensitive_lookup: bool, @@ -5192,7 +5192,7 @@ pub struct InlineValueVariableLookup { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueEvaluatableExpression { /// If specified the expression overrides the extracted expression. pub expression: Option, @@ -5206,7 +5206,7 @@ pub struct InlineValueEvaluatableExpression { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueOptions { pub work_done_progress: Option, } @@ -5216,7 +5216,7 @@ pub struct InlineValueOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintLabelPart { /// An optional command for this label part. /// @@ -5269,7 +5269,7 @@ pub struct InlayHintLabelPart { /// *Please Note* that clients might sanitize the return markdown. A client could decide to /// remove HTML from the markdown to avoid script execution. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MarkupContent { /// The type of the Markup pub kind: MarkupKind, @@ -5282,7 +5282,7 @@ pub struct MarkupContent { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintOptions { /// The server provides support to resolve additional /// information for an inlay hint item. @@ -5295,7 +5295,7 @@ pub struct InlayHintOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RelatedFullDocumentDiagnosticReport { /// The actual items. pub items: Vec, @@ -5324,7 +5324,7 @@ pub struct RelatedFullDocumentDiagnosticReport { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RelatedUnchangedDocumentDiagnosticReport { /// A document diagnostic report indicating /// no changes to the last result. A server can @@ -5352,7 +5352,7 @@ pub struct RelatedUnchangedDocumentDiagnosticReport { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FullDocumentDiagnosticReport { /// The actual items. pub items: Vec, @@ -5371,7 +5371,7 @@ pub struct FullDocumentDiagnosticReport { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct UnchangedDocumentDiagnosticReport { /// A document diagnostic report indicating /// no changes to the last result. A server can @@ -5388,7 +5388,7 @@ pub struct UnchangedDocumentDiagnosticReport { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DiagnosticOptions { /// An optional identifier under which the diagnostics are /// managed by the client. @@ -5410,7 +5410,7 @@ pub struct DiagnosticOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PreviousResultId { /// The URI for which the client knowns a /// result id. @@ -5424,7 +5424,7 @@ pub struct PreviousResultId { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocument { /// The cells of a notebook. pub cells: Vec, @@ -5449,7 +5449,7 @@ pub struct NotebookDocument { /// An item to transfer a text document from the client to the /// server. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentItem { /// The text document's language identifier. pub language_id: String, @@ -5469,7 +5469,7 @@ pub struct TextDocumentItem { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct VersionedNotebookDocumentIdentifier { /// The notebook document's uri. pub uri: String, @@ -5482,7 +5482,7 @@ pub struct VersionedNotebookDocumentIdentifier { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentChangeEvent { /// Changes to cells pub cells: Option, @@ -5497,7 +5497,7 @@ pub struct NotebookDocumentChangeEvent { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentIdentifier { /// The notebook document's uri. pub uri: String, @@ -5509,7 +5509,7 @@ pub struct NotebookDocumentIdentifier { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineCompletionContext { /// Provides information about the currently selected item in the autocomplete widget if it is visible. pub selected_completion_info: Option, @@ -5530,7 +5530,7 @@ pub struct InlineCompletionContext { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct StringValue { /// The kind of string value. pub kind: String, @@ -5545,14 +5545,14 @@ pub struct StringValue { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineCompletionOptions { pub work_done_progress: Option, } /// General parameters to register for a notification or to register a provider. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Registration { /// The id used to register the request. The id can be used to deregister /// the request again. @@ -5567,7 +5567,7 @@ pub struct Registration { /// General parameters to unregister a request or notification. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Unregistration { /// The id used to unregister the request or notification. Usually an id /// provided during the register request. @@ -5579,7 +5579,7 @@ pub struct Unregistration { /// The initialize parameters #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct _InitializeParams { /// The capabilities provided by the client (editor or tool) pub capabilities: ClientCapabilities, @@ -5634,7 +5634,7 @@ pub struct _InitializeParams { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFoldersInitializeParams { /// The workspace folders configured in the client when the server starts. /// @@ -5649,7 +5649,7 @@ pub struct WorkspaceFoldersInitializeParams { /// Defines the capabilities provided by a language /// server. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ServerCapabilities { /// The server provides call hierarchy support. /// @@ -5813,7 +5813,7 @@ pub struct ServerCapabilities { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ServerInfo { /// The name of the server as defined by the server. pub name: String, @@ -5824,7 +5824,7 @@ pub struct ServerInfo { /// A text document identifier to denote a specific version of a text document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct VersionedTextDocumentIdentifier { /// The text document's uri. pub uri: String, @@ -5835,7 +5835,7 @@ pub struct VersionedTextDocumentIdentifier { /// Save options. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SaveOptions { /// The client is supposed to include the content on save. pub include_text: Option, @@ -5843,7 +5843,7 @@ pub struct SaveOptions { /// An event describing a file change. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileEvent { /// The change type. #[serde(rename = "type")] @@ -5854,7 +5854,7 @@ pub struct FileEvent { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileSystemWatcher { /// The glob pattern to watch. See [glob pattern][GlobPattern] for more detail. /// @@ -5870,7 +5870,7 @@ pub struct FileSystemWatcher { /// Represents a diagnostic, such as a compiler error or warning. Diagnostic objects /// are only valid in the scope of a resource. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct Diagnostic { /// The diagnostic's code, which usually appear in the user interface. pub code: Option>, @@ -5914,7 +5914,7 @@ pub struct Diagnostic { /// Contains additional information about the context in which a completion request is triggered. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionContext { /// The trigger character (a single character) that has trigger code complete. /// Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter` @@ -5928,7 +5928,7 @@ pub struct CompletionContext { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionItemLabelDetails { /// An optional string which is rendered less prominently after [`CompletionItem::detail`]. Should be used /// for fully qualified names and file paths. @@ -5943,7 +5943,7 @@ pub struct CompletionItemLabelDetails { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InsertReplaceEdit { /// The range if the insert is requested pub insert: Range, @@ -5969,7 +5969,7 @@ pub struct InsertReplaceEdit { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionItemDefaults { /// A default commit character set. /// @@ -5999,7 +5999,7 @@ pub struct CompletionItemDefaults { /// Completion options. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionOptions { /// The list of all possible characters that commit a completion. This field can be used /// if clients don't support individual commit characters per completion item. See @@ -6036,7 +6036,7 @@ pub struct CompletionOptions { /// Hover options. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct HoverOptions { pub work_done_progress: Option, } @@ -6045,7 +6045,7 @@ pub struct HoverOptions { /// /// @since 3.15.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureHelpContext { /// The currently active `SignatureHelp`. /// @@ -6072,7 +6072,7 @@ pub struct SignatureHelpContext { /// can have a label, like a function-name, a doc-comment, and /// a set of parameters. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureInformation { /// The index of the active parameter. /// @@ -6095,7 +6095,7 @@ pub struct SignatureInformation { /// Server Capabilities for a [SignatureHelpRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureHelpOptions { /// List of characters that re-trigger signature help. /// @@ -6113,7 +6113,7 @@ pub struct SignatureHelpOptions { /// Server Capabilities for a [DefinitionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DefinitionOptions { pub work_done_progress: Option, } @@ -6121,7 +6121,7 @@ pub struct DefinitionOptions { /// Value-object that contains additional information when /// requesting references. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ReferenceContext { /// Include the declaration of the current symbol. pub include_declaration: bool, @@ -6129,21 +6129,21 @@ pub struct ReferenceContext { /// Reference options. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ReferenceOptions { pub work_done_progress: Option, } /// Provider options for a [DocumentHighlightRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentHighlightOptions { pub work_done_progress: Option, } /// A base for all symbol information. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct BaseSymbolInformation { /// The name of the symbol containing this symbol. This information is for /// user interface purposes (e.g. to render a qualifier in the user interface @@ -6165,7 +6165,7 @@ pub struct BaseSymbolInformation { /// Provider options for a [DocumentSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentSymbolOptions { /// A human-readable string that is shown when multiple outlines trees /// are shown for the same document. @@ -6179,7 +6179,7 @@ pub struct DocumentSymbolOptions { /// Contains additional diagnostic information about the context in which /// a [code action][`CodeActionProvider::provideCodeActions`] is run. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionContext { /// An array of diagnostics known on the client side overlapping the range provided to the /// `textDocument/codeAction` request. They are provided so that the server knows which @@ -6206,7 +6206,7 @@ pub struct CodeActionContext { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionDisabled { /// Human readable description of why the code action is currently disabled. /// @@ -6216,7 +6216,7 @@ pub struct CodeActionDisabled { /// Provider options for a [CodeActionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionOptions { /// CodeActionKinds that this server may return. /// @@ -6239,14 +6239,14 @@ pub struct CodeActionOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LocationUriOnly { pub uri: String, } /// Server capabilities for a [WorkspaceSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolOptions { /// The server provides support to resolve additional /// information for a workspace symbol. @@ -6259,7 +6259,7 @@ pub struct WorkspaceSymbolOptions { /// Code Lens provider options of a [CodeLensRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLensOptions { /// Code lens has a resolve provider as well. pub resolve_provider: Option, @@ -6269,7 +6269,7 @@ pub struct CodeLensOptions { /// Provider options for a [DocumentLinkRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentLinkOptions { /// Document links have a resolve provider as well. pub resolve_provider: Option, @@ -6279,7 +6279,7 @@ pub struct DocumentLinkOptions { /// Value-object describing what options formatting should use. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FormattingOptions { /// Insert a newline character at the end of the file if one does not exist. /// @@ -6305,14 +6305,14 @@ pub struct FormattingOptions { /// Provider options for a [DocumentFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentFormattingOptions { pub work_done_progress: Option, } /// Provider options for a [DocumentRangeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentRangeFormattingOptions { /// Whether the server supports formatting multiple ranges at once. /// @@ -6326,7 +6326,7 @@ pub struct DocumentRangeFormattingOptions { /// Provider options for a [DocumentOnTypeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentOnTypeFormattingOptions { /// A character on which formatting should be triggered, like `{`. pub first_trigger_character: String, @@ -6337,7 +6337,7 @@ pub struct DocumentOnTypeFormattingOptions { /// Provider options for a [RenameRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RenameOptions { /// Renames should be checked and tested before being executed. /// @@ -6351,7 +6351,7 @@ pub struct RenameOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PrepareRenamePlaceholder { pub placeholder: String, @@ -6362,14 +6362,14 @@ pub struct PrepareRenamePlaceholder { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PrepareRenameDefaultBehavior { pub default_behavior: bool, } /// The server capabilities of a [ExecuteCommandRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ExecuteCommandOptions { /// The commands to be executed on the server pub commands: Vec, @@ -6379,7 +6379,7 @@ pub struct ExecuteCommandOptions { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensLegend { /// The token modifiers a server uses. pub token_modifiers: Vec, @@ -6394,7 +6394,7 @@ pub struct SemanticTokensLegend { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensFullDelta { /// The server supports deltas for full documents. pub delta: Option, @@ -6402,7 +6402,7 @@ pub struct SemanticTokensFullDelta { /// A text document identifier to optionally denote a specific version of a text document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct OptionalVersionedTextDocumentIdentifier { /// The text document's uri. pub uri: String, @@ -6420,7 +6420,7 @@ pub struct OptionalVersionedTextDocumentIdentifier { /// /// @since 3.16.0. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct AnnotatedTextEdit { /// The actual identifier of the change annotation pub annotation_id: ChangeAnnotationIdentifier, @@ -6436,7 +6436,7 @@ pub struct AnnotatedTextEdit { /// A generic resource operation. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ResourceOperation { /// An optional annotation identifier describing the operation. /// @@ -6449,7 +6449,7 @@ pub struct ResourceOperation { /// Options to create a file. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CreateFileOptions { /// Ignore if exists. pub ignore_if_exists: Option, @@ -6460,7 +6460,7 @@ pub struct CreateFileOptions { /// Rename file options #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RenameFileOptions { /// Ignores if target exists. pub ignore_if_exists: Option, @@ -6471,7 +6471,7 @@ pub struct RenameFileOptions { /// Delete file options #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DeleteFileOptions { /// Ignore the operation if the file doesn't exist. pub ignore_if_not_exists: Option, @@ -6485,7 +6485,7 @@ pub struct DeleteFileOptions { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileOperationPattern { /// The glob pattern to match. Glob patterns can have the following syntax: /// - `*` to match one or more characters in a path segment @@ -6509,7 +6509,7 @@ pub struct FileOperationPattern { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFullDocumentDiagnosticReport { /// The actual items. pub items: Vec, @@ -6535,7 +6535,7 @@ pub struct WorkspaceFullDocumentDiagnosticReport { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceUnchangedDocumentDiagnosticReport { /// A document diagnostic report indicating /// no changes to the last result. A server can @@ -6564,7 +6564,7 @@ pub struct WorkspaceUnchangedDocumentDiagnosticReport { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookCell { /// The URI of the cell's text document /// content. @@ -6589,7 +6589,7 @@ pub struct NotebookCell { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentCellChanges { /// Changes to notebook cells properties like its /// kind, execution summary or metadata. @@ -6609,7 +6609,7 @@ pub struct NotebookDocumentCellChanges { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SelectedCompletionInfo { /// The range that will be replaced if this completion item is accepted. pub range: Range, @@ -6625,7 +6625,7 @@ pub struct SelectedCompletionInfo { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientInfo { /// The name of the client as defined by the client. pub name: String, @@ -6636,7 +6636,7 @@ pub struct ClientInfo { /// Defines the capabilities provided by the client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCapabilities { /// Experimental client capabilities. pub experimental: Option, @@ -6662,7 +6662,7 @@ pub struct ClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSyncOptions { /// Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full /// and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None. @@ -6699,7 +6699,7 @@ pub struct TextDocumentSyncOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentSyncOptions { /// The notebooks to be synced pub notebook_selector: @@ -6714,7 +6714,7 @@ pub struct NotebookDocumentSyncOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentSyncRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. @@ -6735,7 +6735,7 @@ pub struct NotebookDocumentSyncRegistrationOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceOptions { /// The server is interested in notifications/requests for operations on files. /// @@ -6752,7 +6752,7 @@ pub struct WorkspaceOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentContentChangePartial { /// The range of the document that changed. pub range: Range, @@ -6771,7 +6771,7 @@ pub struct TextDocumentContentChangePartial { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentContentChangeWholeDocument { /// The new text of the whole document. pub text: String, @@ -6781,7 +6781,7 @@ pub struct TextDocumentContentChangeWholeDocument { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeDescription { /// An URI to open with more information about the diagnostic error. pub href: String, @@ -6791,7 +6791,7 @@ pub struct CodeDescription { /// used to point to code locations that cause or related to a diagnostics, e.g when duplicating /// a symbol in a scope. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DiagnosticRelatedInformation { /// The location of this related diagnostic information. pub location: Location, @@ -6806,7 +6806,7 @@ pub struct DiagnosticRelatedInformation { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct EditRangeWithInsertReplace { pub insert: Range, @@ -6817,7 +6817,7 @@ pub struct EditRangeWithInsertReplace { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ServerCompletionItemOptions { /// The server has support for completion item label /// details (see also `CompletionItemLabelDetails`) when @@ -6833,7 +6833,7 @@ pub struct ServerCompletionItemOptions { #[deprecated] #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MarkedStringWithLanguage { pub language: String, @@ -6843,7 +6843,7 @@ pub struct MarkedStringWithLanguage { /// Represents a parameter of a callable-signature. A parameter can /// have a label and a doc-comment. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ParameterInformation { /// The human-readable doc-comment of this parameter. Will be shown /// in the UI but can be omitted. @@ -6865,7 +6865,7 @@ pub struct ParameterInformation { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookCellTextDocumentFilter { /// A language id like `python`. /// @@ -6884,14 +6884,14 @@ pub struct NotebookCellTextDocumentFilter { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileOperationPatternOptions { /// The pattern should be matched ignoring casing. pub ignore_case: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ExecutionSummary { /// A strict monotonically increasing value /// indicating the execution order of a cell @@ -6909,7 +6909,7 @@ pub struct ExecutionSummary { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentCellChangeStructure { /// The change to the cell array. pub array: NotebookCellArrayChange, @@ -6927,7 +6927,7 @@ pub struct NotebookDocumentCellChangeStructure { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentCellContentChanges { pub changes: Vec, @@ -6936,7 +6936,7 @@ pub struct NotebookDocumentCellContentChanges { /// Workspace specific client capabilities. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceClientCapabilities { /// The client supports applying batch edits /// to the workspace by supporting the request @@ -7013,7 +7013,7 @@ pub struct WorkspaceClientCapabilities { /// Text document specific client capabilities. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentClientCapabilities { /// Capabilities specific to the various call hierarchy requests. /// @@ -7146,7 +7146,7 @@ pub struct TextDocumentClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentClientCapabilities { /// Capabilities specific to notebook document synchronization /// @@ -7155,7 +7155,7 @@ pub struct NotebookDocumentClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowClientCapabilities { /// Capabilities specific to the showDocument request. /// @@ -7183,7 +7183,7 @@ pub struct WindowClientCapabilities { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct GeneralClientCapabilities { /// Client capabilities specific to the client's markdown parser. /// @@ -7228,7 +7228,7 @@ pub struct GeneralClientCapabilities { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentFilterWithNotebook { /// The cells of the matching notebook to be synced. pub cells: Option>, @@ -7243,7 +7243,7 @@ pub struct NotebookDocumentFilterWithNotebook { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentFilterWithCells { /// The cells of the matching notebook to be synced. pub cells: Vec, @@ -7255,7 +7255,7 @@ pub struct NotebookDocumentFilterWithCells { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFoldersServerCapabilities { /// Whether the server wants to receive workspace folder /// change notifications. @@ -7274,7 +7274,7 @@ pub struct WorkspaceFoldersServerCapabilities { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileOperationOptions { /// The server is interested in receiving didCreateFiles notifications. pub did_create: Option, @@ -7301,7 +7301,7 @@ pub struct FileOperationOptions { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RelativePattern { /// A workspace folder or a base URI to which this pattern will be matched /// against relatively. @@ -7317,7 +7317,7 @@ pub struct RelativePattern { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentFilterLanguage { /// A language id, like `typescript`. pub language: String, @@ -7335,7 +7335,7 @@ pub struct TextDocumentFilterLanguage { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentFilterScheme { /// A language id, like `typescript`. pub language: Option, @@ -7353,7 +7353,7 @@ pub struct TextDocumentFilterScheme { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentFilterPattern { /// A language id, like `typescript`. pub language: Option, @@ -7370,7 +7370,7 @@ pub struct TextDocumentFilterPattern { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookCellArrayChange { /// The new cells, if any pub cells: Option>, @@ -7383,7 +7383,7 @@ pub struct NotebookCellArrayChange { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceEditClientCapabilities { /// Whether the client in general supports change annotations on text edits, /// create file, rename file and delete file changes. @@ -7417,14 +7417,14 @@ pub struct WorkspaceEditClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeConfigurationClientCapabilities { /// Did change configuration notification supports dynamic registration. pub dynamic_registration: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DidChangeWatchedFilesClientCapabilities { /// Did change watched files notification supports dynamic registration. Please note /// that the current protocol doesn't support static configuration for file changes @@ -7440,7 +7440,7 @@ pub struct DidChangeWatchedFilesClientCapabilities { /// Client capabilities for a [WorkspaceSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolClientCapabilities { /// Symbol request supports dynamic registration. pub dynamic_registration: Option, @@ -7464,7 +7464,7 @@ pub struct WorkspaceSymbolClientCapabilities { /// The client capabilities of a [ExecuteCommandRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ExecuteCommandClientCapabilities { /// Execute command supports dynamic registration. pub dynamic_registration: Option, @@ -7472,7 +7472,7 @@ pub struct ExecuteCommandClientCapabilities { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensWorkspaceClientCapabilities { /// Whether the client implementation supports a refresh request sent from /// the server to the client. @@ -7486,7 +7486,7 @@ pub struct SemanticTokensWorkspaceClientCapabilities { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLensWorkspaceClientCapabilities { /// Whether the client implementation supports a refresh request sent from the /// server to the client. @@ -7505,7 +7505,7 @@ pub struct CodeLensWorkspaceClientCapabilities { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FileOperationClientCapabilities { /// The client has support for sending didCreateFiles notifications. pub did_create: Option, @@ -7533,7 +7533,7 @@ pub struct FileOperationClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueWorkspaceClientCapabilities { /// Whether the client implementation supports a refresh request sent from the /// server to the client. @@ -7549,7 +7549,7 @@ pub struct InlineValueWorkspaceClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintWorkspaceClientCapabilities { /// Whether the client implementation supports a refresh request sent from /// the server to the client. @@ -7565,7 +7565,7 @@ pub struct InlayHintWorkspaceClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DiagnosticWorkspaceClientCapabilities { /// Whether the client implementation supports a refresh request sent from /// the server to the client. @@ -7583,7 +7583,7 @@ pub struct DiagnosticWorkspaceClientCapabilities { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FoldingRangeWorkspaceClientCapabilities { /// Whether the client implementation supports a refresh request sent from the /// server to the client. @@ -7600,7 +7600,7 @@ pub struct FoldingRangeWorkspaceClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSyncClientCapabilities { /// The client supports did save notifications. pub did_save: Option, @@ -7619,7 +7619,7 @@ pub struct TextDocumentSyncClientCapabilities { /// Completion client capabilities #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionClientCapabilities { /// The client supports the following `CompletionItem` specific /// capabilities. @@ -7649,7 +7649,7 @@ pub struct CompletionClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct HoverClientCapabilities { /// Client supports the following content formats for the content /// property. The order describes the preferred format of the client. @@ -7661,7 +7661,7 @@ pub struct HoverClientCapabilities { /// Client Capabilities for a [SignatureHelpRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SignatureHelpClientCapabilities { /// The client supports to send additional context information for a /// `textDocument/signatureHelp` request. A client that opts into @@ -7681,7 +7681,7 @@ pub struct SignatureHelpClientCapabilities { /// @since 3.14.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DeclarationClientCapabilities { /// Whether declaration supports dynamic registration. If this is set to `true` /// the client supports the new `DeclarationRegistrationOptions` return value @@ -7694,7 +7694,7 @@ pub struct DeclarationClientCapabilities { /// Client Capabilities for a [DefinitionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DefinitionClientCapabilities { /// Whether definition supports dynamic registration. pub dynamic_registration: Option, @@ -7707,7 +7707,7 @@ pub struct DefinitionClientCapabilities { /// Since 3.6.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeDefinitionClientCapabilities { /// Whether implementation supports dynamic registration. If this is set to `true` /// the client supports the new `TypeDefinitionRegistrationOptions` return value @@ -7722,7 +7722,7 @@ pub struct TypeDefinitionClientCapabilities { /// @since 3.6.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ImplementationClientCapabilities { /// Whether implementation supports dynamic registration. If this is set to `true` /// the client supports the new `ImplementationRegistrationOptions` return value @@ -7737,7 +7737,7 @@ pub struct ImplementationClientCapabilities { /// Client Capabilities for a [ReferencesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ReferenceClientCapabilities { /// Whether references supports dynamic registration. pub dynamic_registration: Option, @@ -7745,7 +7745,7 @@ pub struct ReferenceClientCapabilities { /// Client Capabilities for a [DocumentHighlightRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentHighlightClientCapabilities { /// Whether document highlight supports dynamic registration. pub dynamic_registration: Option, @@ -7753,7 +7753,7 @@ pub struct DocumentHighlightClientCapabilities { /// Client Capabilities for a [DocumentSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentSymbolClientCapabilities { /// Whether document symbol supports dynamic registration. pub dynamic_registration: Option, @@ -7781,7 +7781,7 @@ pub struct DocumentSymbolClientCapabilities { /// The Client Capabilities of a [CodeActionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionClientCapabilities { /// The client support code action literals of type `CodeAction` as a valid /// response of the `textDocument/codeAction` request. If the property is not @@ -7828,7 +7828,7 @@ pub struct CodeActionClientCapabilities { /// The client capabilities of a [CodeLensRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLensClientCapabilities { /// Whether code lens supports dynamic registration. pub dynamic_registration: Option, @@ -7836,7 +7836,7 @@ pub struct CodeLensClientCapabilities { /// The client capabilities of a [DocumentLinkRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentLinkClientCapabilities { /// Whether document link supports dynamic registration. pub dynamic_registration: Option, @@ -7848,7 +7848,7 @@ pub struct DocumentLinkClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentColorClientCapabilities { /// Whether implementation supports dynamic registration. If this is set to `true` /// the client supports the new `DocumentColorRegistrationOptions` return value @@ -7858,7 +7858,7 @@ pub struct DocumentColorClientCapabilities { /// Client capabilities of a [DocumentFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentFormattingClientCapabilities { /// Whether formatting supports dynamic registration. pub dynamic_registration: Option, @@ -7866,7 +7866,7 @@ pub struct DocumentFormattingClientCapabilities { /// Client capabilities of a [DocumentRangeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentRangeFormattingClientCapabilities { /// Whether range formatting supports dynamic registration. pub dynamic_registration: Option, @@ -7881,14 +7881,14 @@ pub struct DocumentRangeFormattingClientCapabilities { /// Client capabilities of a [DocumentOnTypeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentOnTypeFormattingClientCapabilities { /// Whether on type formatting supports dynamic registration. pub dynamic_registration: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RenameClientCapabilities { /// Whether rename supports dynamic registration. pub dynamic_registration: Option, @@ -7918,7 +7918,7 @@ pub struct RenameClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct FoldingRangeClientCapabilities { /// Whether implementation supports dynamic registration for folding range /// providers. If this is set to `true` the client supports the new @@ -7948,7 +7948,7 @@ pub struct FoldingRangeClientCapabilities { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SelectionRangeClientCapabilities { /// Whether implementation supports dynamic registration for selection range providers. If this is set to `true` /// the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server @@ -7958,7 +7958,7 @@ pub struct SelectionRangeClientCapabilities { /// The publish diagnostic client capabilities. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PublishDiagnosticsClientCapabilities { /// Client supports a codeDescription property /// @@ -7990,7 +7990,7 @@ pub struct PublishDiagnosticsClientCapabilities { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyClientCapabilities { /// Whether implementation supports dynamic registration. If this is set to `true` /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` @@ -8000,7 +8000,7 @@ pub struct CallHierarchyClientCapabilities { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SemanticTokensClientCapabilities { /// Whether the client uses semantic tokens to augment existing /// syntax tokens. If set to `true` client side created syntax @@ -8057,7 +8057,7 @@ pub struct SemanticTokensClientCapabilities { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LinkedEditingRangeClientCapabilities { /// Whether implementation supports dynamic registration. If this is set to `true` /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` @@ -8069,7 +8069,7 @@ pub struct LinkedEditingRangeClientCapabilities { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MonikerClientCapabilities { /// Whether moniker supports dynamic registration. If this is set to `true` /// the client supports the new `MonikerRegistrationOptions` return value @@ -8079,7 +8079,7 @@ pub struct MonikerClientCapabilities { /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchyClientCapabilities { /// Whether implementation supports dynamic registration. If this is set to `true` /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` @@ -8091,7 +8091,7 @@ pub struct TypeHierarchyClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineValueClientCapabilities { /// Whether implementation supports dynamic registration for inline value providers. pub dynamic_registration: Option, @@ -8101,7 +8101,7 @@ pub struct InlineValueClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintClientCapabilities { /// Whether inlay hints support dynamic registration. pub dynamic_registration: Option, @@ -8115,7 +8115,7 @@ pub struct InlayHintClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DiagnosticClientCapabilities { /// Whether implementation supports dynamic registration. If this is set to `true` /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` @@ -8132,7 +8132,7 @@ pub struct DiagnosticClientCapabilities { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlineCompletionClientCapabilities { /// Whether implementation supports dynamic registration for inline completion providers. pub dynamic_registration: Option, @@ -8142,7 +8142,7 @@ pub struct InlineCompletionClientCapabilities { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentSyncClientCapabilities { /// Whether implementation supports dynamic registration. If this is /// set to `true` the client supports the new @@ -8156,7 +8156,7 @@ pub struct NotebookDocumentSyncClientCapabilities { /// Show message request client capabilities #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShowMessageRequestClientCapabilities { /// Capabilities specific to the `MessageActionItem` type. pub message_action_item: Option, @@ -8166,7 +8166,7 @@ pub struct ShowMessageRequestClientCapabilities { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShowDocumentClientCapabilities { /// The client has support for the showDocument /// request. @@ -8177,7 +8177,7 @@ pub struct ShowDocumentClientCapabilities { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct StaleRequestSupportOptions { /// The client will actively cancel the request. pub cancel: bool, @@ -8192,7 +8192,7 @@ pub struct StaleRequestSupportOptions { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct RegularExpressionsClientCapabilities { /// The engine's name. pub engine: String, @@ -8205,7 +8205,7 @@ pub struct RegularExpressionsClientCapabilities { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct MarkdownClientCapabilities { /// A list of HTML tags that the client allows / supports in /// Markdown. @@ -8224,7 +8224,7 @@ pub struct MarkdownClientCapabilities { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookCellLanguage { pub language: String, } @@ -8235,7 +8235,7 @@ pub struct NotebookCellLanguage { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentFilterNotebookType { /// The type of the enclosing notebook. pub notebook_type: String, @@ -8253,7 +8253,7 @@ pub struct NotebookDocumentFilterNotebookType { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentFilterScheme { /// The type of the enclosing notebook. pub notebook_type: Option, @@ -8271,7 +8271,7 @@ pub struct NotebookDocumentFilterScheme { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentFilterPattern { /// The type of the enclosing notebook. pub notebook_type: Option, @@ -8287,7 +8287,7 @@ pub struct NotebookDocumentFilterPattern { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ChangeAnnotationsSupportOptions { /// Whether the client groups edits with equal labels into tree nodes, /// for instance all edits labelled with "Changes in Strings" would @@ -8299,7 +8299,7 @@ pub struct ChangeAnnotationsSupportOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientSymbolKindOptions { /// The symbol kind values the client supports. When this /// property exists the client also guarantees that it will @@ -8316,7 +8316,7 @@ pub struct ClientSymbolKindOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientSymbolTagOptions { /// The tags supported by the client. pub value_set: Vec, @@ -8326,7 +8326,7 @@ pub struct ClientSymbolTagOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientSymbolResolveOptions { /// The properties that a client can resolve lazily. Usually /// `location.range` @@ -8337,7 +8337,7 @@ pub struct ClientSymbolResolveOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCompletionItemOptions { /// Client supports commit characters on a completion item. pub commit_characters_support: Option, @@ -8399,7 +8399,7 @@ pub struct ClientCompletionItemOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCompletionItemOptionsKind { /// The completion item kind values the client supports. When this /// property exists the client also guarantees that it will @@ -8417,7 +8417,7 @@ pub struct ClientCompletionItemOptionsKind { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionListCapabilities { /// The client supports the following itemDefaults on /// a completion list. @@ -8434,7 +8434,7 @@ pub struct CompletionListCapabilities { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientSignatureInformationOptions { /// The client supports the `activeParameter` property on `SignatureInformation` /// literal. @@ -8454,7 +8454,7 @@ pub struct ClientSignatureInformationOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCodeActionLiteralOptions { /// The code action kind is support with the following value /// set. @@ -8465,7 +8465,7 @@ pub struct ClientCodeActionLiteralOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCodeActionResolveOptions { /// The properties that a client can resolve lazily. pub properties: Vec, @@ -8475,7 +8475,7 @@ pub struct ClientCodeActionResolveOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientFoldingRangeKindOptions { /// The folding range kind values the client supports. When this /// property exists the client also guarantees that it will @@ -8488,7 +8488,7 @@ pub struct ClientFoldingRangeKindOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientFoldingRangeOptions { /// If set, the client signals that it supports setting collapsedText on /// folding ranges to display custom labels instead of the default text. @@ -8501,7 +8501,7 @@ pub struct ClientFoldingRangeOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientDiagnosticsTagOptions { /// The tags supported by the client. pub value_set: Vec, @@ -8511,7 +8511,7 @@ pub struct ClientDiagnosticsTagOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientSemanticTokensRequestOptions { /// The client will send the `textDocument/semanticTokens/full` request if /// the server provides a corresponding handler. @@ -8526,7 +8526,7 @@ pub struct ClientSemanticTokensRequestOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientInlayHintResolveOptions { /// The properties that a client can resolve lazily. pub properties: Vec, @@ -8536,7 +8536,7 @@ pub struct ClientInlayHintResolveOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientShowMessageActionItemOptions { /// Whether the client supports additional attributes which /// are preserved and send back to the server in the @@ -8548,7 +8548,7 @@ pub struct ClientShowMessageActionItemOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionItemTagOptions { /// The tags supported by the client. pub value_set: Vec, @@ -8558,7 +8558,7 @@ pub struct CompletionItemTagOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCompletionItemResolveOptions { /// The properties that a client can resolve lazily. pub properties: Vec, @@ -8568,7 +8568,7 @@ pub struct ClientCompletionItemResolveOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCompletionItemInsertTextModeOptions { pub value_set: Vec, } @@ -8577,7 +8577,7 @@ pub struct ClientCompletionItemInsertTextModeOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientSignatureParameterInformationOptions { /// The client supports processing label offsets instead of a /// simple label string. @@ -8590,7 +8590,7 @@ pub struct ClientSignatureParameterInformationOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientCodeActionKindOptions { /// The code action kind values the client supports. When this /// property exists the client also guarantees that it will @@ -8603,7 +8603,7 @@ pub struct ClientCodeActionKindOptions { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientSemanticTokensRequestFullDelta { /// The client will send the `textDocument/semanticTokens/full/delta` request if /// the server provides a corresponding handler. @@ -8613,7 +8613,7 @@ pub struct ClientSemanticTokensRequestFullDelta { /// The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace /// folder configuration changes. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDidChangeWorkspaceFoldersNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8627,7 +8627,7 @@ pub struct WorkspaceDidChangeWorkspaceFoldersNotification { /// The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress /// initiated on the server side. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowWorkDoneProgressCancelNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8643,7 +8643,7 @@ pub struct WindowWorkDoneProgressCancelNotification { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDidCreateFilesNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8659,7 +8659,7 @@ pub struct WorkspaceDidCreateFilesNotification { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDidRenameFilesNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8675,7 +8675,7 @@ pub struct WorkspaceDidRenameFilesNotification { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDidDeleteFilesNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8690,7 +8690,7 @@ pub struct WorkspaceDidDeleteFilesNotification { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentDidOpenNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8702,7 +8702,7 @@ pub struct NotebookDocumentDidOpenNotification { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentDidChangeNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8717,7 +8717,7 @@ pub struct NotebookDocumentDidChangeNotification { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentDidSaveNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8732,7 +8732,7 @@ pub struct NotebookDocumentDidSaveNotification { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct NotebookDocumentDidCloseNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8747,7 +8747,7 @@ pub struct NotebookDocumentDidCloseNotification { /// server after the client is fully initialized and the server /// is allowed to send requests from the server to the client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InitializedNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8761,20 +8761,22 @@ pub struct InitializedNotification { /// The exit event is sent from the client to the server to /// ask the server to exit its process. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ExitNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, /// The method to be invoked. pub method: LSPNotificationMethods, + + pub params: LSPNull, } /// The configuration change notification is sent from the client to the server /// when the client's configuration has changed. The notification contains /// the changed configuration as defined by the language client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDidChangeConfigurationNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8788,7 +8790,7 @@ pub struct WorkspaceDidChangeConfigurationNotification { /// The show message notification is sent from a server to a client to ask /// the client to display a particular message in the user interface. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowShowMessageNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8802,7 +8804,7 @@ pub struct WindowShowMessageNotification { /// The log message notification is sent from the server to the client to ask /// the client to log a particular message. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowLogMessageNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8816,7 +8818,7 @@ pub struct WindowLogMessageNotification { /// The telemetry event notification is sent from the server to the client to ask /// the client to log telemetry data. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TelemetryEventNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8836,7 +8838,7 @@ pub struct TelemetryEventNotification { /// This means open and close notification must be balanced and the max open count /// is one. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDidOpenNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8850,7 +8852,7 @@ pub struct TextDocumentDidOpenNotification { /// The document change notification is sent from the client to the server to signal /// changes to a text document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDidChangeNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8869,7 +8871,7 @@ pub struct TextDocumentDidChangeNotification { /// doesn't mean that the document was open in an editor before. A close /// notification requires a previous open notification to be sent. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDidCloseNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8883,7 +8885,7 @@ pub struct TextDocumentDidCloseNotification { /// The document save notification is sent from the client to the server when /// the document got saved in the client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDidSaveNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8897,7 +8899,7 @@ pub struct TextDocumentDidSaveNotification { /// A document will save notification is sent from the client to the server before /// the document is actually saved. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentWillSaveNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8911,7 +8913,7 @@ pub struct TextDocumentWillSaveNotification { /// The watched files notification is sent from the client to the server when /// the client detects changes to file watched by the language client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDidChangeWatchedFilesNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8925,7 +8927,7 @@ pub struct WorkspaceDidChangeWatchedFilesNotification { /// Diagnostics notification are sent from the server to the client to signal /// results of validation runs. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPublishDiagnosticsNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8937,7 +8939,7 @@ pub struct TextDocumentPublishDiagnosticsNotification { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SetTraceNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8949,7 +8951,7 @@ pub struct SetTraceNotification { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct LogTraceNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8961,7 +8963,7 @@ pub struct LogTraceNotification { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CancelRequestNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -8973,7 +8975,7 @@ pub struct CancelRequestNotification { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ProgressNotification { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9005,7 +9007,7 @@ pub enum LSPIdOptional { /// document position. The request's parameter is of type [TextDocumentPositionParams] /// the response is of type [Definition] or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentImplementationRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9021,7 +9023,7 @@ pub struct TextDocumentImplementationRequest { /// Response to the [TextDocumentImplementationRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentImplementationResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9040,7 +9042,7 @@ pub struct TextDocumentImplementationResponse { /// document position. The request's parameter is of type [TextDocumentPositionParams] /// the response is of type [Definition] or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentTypeDefinitionRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9056,7 +9058,7 @@ pub struct TextDocumentTypeDefinitionRequest { /// Response to the [TextDocumentTypeDefinitionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentTypeDefinitionResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9073,7 +9075,7 @@ pub struct TextDocumentTypeDefinitionResponse { /// The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWorkspaceFoldersRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9087,7 +9089,7 @@ pub struct WorkspaceWorkspaceFoldersRequest { /// Response to the [WorkspaceWorkspaceFoldersRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWorkspaceFoldersResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9110,7 +9112,7 @@ pub struct WorkspaceWorkspaceFoldersResponse { /// result of `workspace/configuration` requests) the server should register for an empty configuration /// change event and empty the cache if such an event is received. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceConfigurationRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9126,7 +9128,7 @@ pub struct WorkspaceConfigurationRequest { /// Response to the [WorkspaceConfigurationRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceConfigurationResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9145,7 +9147,7 @@ pub struct WorkspaceConfigurationResponse { /// response is of type {@link ColorInformation ColorInformation[]} or a Thenable /// that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentColorRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9161,7 +9163,7 @@ pub struct TextDocumentDocumentColorRequest { /// Response to the [TextDocumentDocumentColorRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentColorResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9180,7 +9182,7 @@ pub struct TextDocumentDocumentColorResponse { /// response is of type {@link ColorInformation ColorInformation[]} or a Thenable /// that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentColorPresentationRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9196,7 +9198,7 @@ pub struct TextDocumentColorPresentationRequest { /// Response to the [TextDocumentColorPresentationRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentColorPresentationResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9215,7 +9217,7 @@ pub struct TextDocumentColorPresentationResponse { /// response is of type [FoldingRangeList] or a Thenable /// that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentFoldingRangeRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9231,7 +9233,7 @@ pub struct TextDocumentFoldingRangeRequest { /// Response to the [TextDocumentFoldingRangeRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentFoldingRangeResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9250,7 +9252,7 @@ pub struct TextDocumentFoldingRangeResponse { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFoldingRangeRefreshRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9264,7 +9266,7 @@ pub struct WorkspaceFoldingRangeRefreshRequest { /// Response to the [WorkspaceFoldingRangeRefreshRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceFoldingRangeRefreshResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9283,7 +9285,7 @@ pub struct WorkspaceFoldingRangeRefreshResponse { /// the response is of type [Declaration] or a typed array of [DeclarationLink] /// or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDeclarationRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9299,7 +9301,7 @@ pub struct TextDocumentDeclarationRequest { /// Response to the [TextDocumentDeclarationRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDeclarationResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9319,7 +9321,7 @@ pub struct TextDocumentDeclarationResponse { /// response is of type {@link SelectionRange SelectionRange[]} or a Thenable /// that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSelectionRangeRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9335,7 +9337,7 @@ pub struct TextDocumentSelectionRangeRequest { /// Response to the [TextDocumentSelectionRangeRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSelectionRangeResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9353,7 +9355,7 @@ pub struct TextDocumentSelectionRangeResponse { /// The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress /// reporting from the server. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowWorkDoneProgressCreateRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9369,7 +9371,7 @@ pub struct WindowWorkDoneProgressCreateRequest { /// Response to the [WindowWorkDoneProgressCreateRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowWorkDoneProgressCreateResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9388,7 +9390,7 @@ pub struct WindowWorkDoneProgressCreateResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPrepareCallHierarchyRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9404,7 +9406,7 @@ pub struct TextDocumentPrepareCallHierarchyRequest { /// Response to the [TextDocumentPrepareCallHierarchyRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPrepareCallHierarchyResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9423,7 +9425,7 @@ pub struct TextDocumentPrepareCallHierarchyResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyIncomingCallsRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9439,7 +9441,7 @@ pub struct CallHierarchyIncomingCallsRequest { /// Response to the [CallHierarchyIncomingCallsRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyIncomingCallsResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9458,7 +9460,7 @@ pub struct CallHierarchyIncomingCallsResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyOutgoingCallsRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9474,7 +9476,7 @@ pub struct CallHierarchyOutgoingCallsRequest { /// Response to the [CallHierarchyOutgoingCallsRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CallHierarchyOutgoingCallsResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9491,7 +9493,7 @@ pub struct CallHierarchyOutgoingCallsResponse { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSemanticTokensFullRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9507,7 +9509,7 @@ pub struct TextDocumentSemanticTokensFullRequest { /// Response to the [TextDocumentSemanticTokensFullRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSemanticTokensFullResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9524,7 +9526,7 @@ pub struct TextDocumentSemanticTokensFullResponse { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSemanticTokensFullDeltaRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9540,7 +9542,7 @@ pub struct TextDocumentSemanticTokensFullDeltaRequest { /// Response to the [TextDocumentSemanticTokensFullDeltaRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSemanticTokensFullDeltaResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9557,7 +9559,7 @@ pub struct TextDocumentSemanticTokensFullDeltaResponse { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSemanticTokensRangeRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9573,7 +9575,7 @@ pub struct TextDocumentSemanticTokensRangeRequest { /// Response to the [TextDocumentSemanticTokensRangeRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSemanticTokensRangeResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9590,7 +9592,7 @@ pub struct TextDocumentSemanticTokensRangeResponse { /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSemanticTokensRefreshRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9604,7 +9606,7 @@ pub struct WorkspaceSemanticTokensRefreshRequest { /// Response to the [WorkspaceSemanticTokensRefreshRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSemanticTokensRefreshResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9625,7 +9627,7 @@ pub struct WorkspaceSemanticTokensRefreshResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowShowDocumentRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9641,7 +9643,7 @@ pub struct WindowShowDocumentRequest { /// Response to the [WindowShowDocumentRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowShowDocumentResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9659,7 +9661,7 @@ pub struct WindowShowDocumentResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentLinkedEditingRangeRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9675,7 +9677,7 @@ pub struct TextDocumentLinkedEditingRangeRequest { /// Response to the [TextDocumentLinkedEditingRangeRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentLinkedEditingRangeResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9699,7 +9701,7 @@ pub struct TextDocumentLinkedEditingRangeResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWillCreateFilesRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9715,7 +9717,7 @@ pub struct WorkspaceWillCreateFilesRequest { /// Response to the [WorkspaceWillCreateFilesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWillCreateFilesResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9735,7 +9737,7 @@ pub struct WorkspaceWillCreateFilesResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWillRenameFilesRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9751,7 +9753,7 @@ pub struct WorkspaceWillRenameFilesRequest { /// Response to the [WorkspaceWillRenameFilesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWillRenameFilesResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9771,7 +9773,7 @@ pub struct WorkspaceWillRenameFilesResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWillDeleteFilesRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9787,7 +9789,7 @@ pub struct WorkspaceWillDeleteFilesRequest { /// Response to the [WorkspaceWillDeleteFilesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceWillDeleteFilesResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9806,7 +9808,7 @@ pub struct WorkspaceWillDeleteFilesResponse { /// The request parameter is of type [TextDocumentPositionParams]. /// The response is of type {@link Moniker Moniker[]} or `null`. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentMonikerRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9822,7 +9824,7 @@ pub struct TextDocumentMonikerRequest { /// Response to the [TextDocumentMonikerRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentMonikerResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9842,7 +9844,7 @@ pub struct TextDocumentMonikerResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPrepareTypeHierarchyRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9858,7 +9860,7 @@ pub struct TextDocumentPrepareTypeHierarchyRequest { /// Response to the [TextDocumentPrepareTypeHierarchyRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPrepareTypeHierarchyResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9877,7 +9879,7 @@ pub struct TextDocumentPrepareTypeHierarchyResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchySupertypesRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9893,7 +9895,7 @@ pub struct TypeHierarchySupertypesRequest { /// Response to the [TypeHierarchySupertypesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchySupertypesResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9912,7 +9914,7 @@ pub struct TypeHierarchySupertypesResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchySubtypesRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9928,7 +9930,7 @@ pub struct TypeHierarchySubtypesRequest { /// Response to the [TypeHierarchySubtypesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TypeHierarchySubtypesResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9949,7 +9951,7 @@ pub struct TypeHierarchySubtypesResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentInlineValueRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9965,7 +9967,7 @@ pub struct TextDocumentInlineValueRequest { /// Response to the [TextDocumentInlineValueRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentInlineValueResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9982,7 +9984,7 @@ pub struct TextDocumentInlineValueResponse { /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceInlineValueRefreshRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -9996,7 +9998,7 @@ pub struct WorkspaceInlineValueRefreshRequest { /// Response to the [WorkspaceInlineValueRefreshRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceInlineValueRefreshResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10016,7 +10018,7 @@ pub struct WorkspaceInlineValueRefreshResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentInlayHintRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10032,7 +10034,7 @@ pub struct TextDocumentInlayHintRequest { /// Response to the [TextDocumentInlayHintRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentInlayHintResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10053,7 +10055,7 @@ pub struct TextDocumentInlayHintResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintResolveRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10069,7 +10071,7 @@ pub struct InlayHintResolveRequest { /// Response to the [InlayHintResolveRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InlayHintResolveResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10085,7 +10087,7 @@ pub struct InlayHintResolveResponse { /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceInlayHintRefreshRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10099,7 +10101,7 @@ pub struct WorkspaceInlayHintRefreshRequest { /// Response to the [WorkspaceInlayHintRefreshRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceInlayHintRefreshResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10117,7 +10119,7 @@ pub struct WorkspaceInlayHintRefreshResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDiagnosticRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10133,7 +10135,7 @@ pub struct TextDocumentDiagnosticRequest { /// Response to the [TextDocumentDiagnosticRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDiagnosticResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10151,7 +10153,7 @@ pub struct TextDocumentDiagnosticResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDiagnosticRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10167,7 +10169,7 @@ pub struct WorkspaceDiagnosticRequest { /// Response to the [WorkspaceDiagnosticRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDiagnosticResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10185,7 +10187,7 @@ pub struct WorkspaceDiagnosticResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDiagnosticRefreshRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10199,7 +10201,7 @@ pub struct WorkspaceDiagnosticRefreshRequest { /// Response to the [WorkspaceDiagnosticRefreshRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceDiagnosticRefreshResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10221,7 +10223,7 @@ pub struct WorkspaceDiagnosticRefreshResponse { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentInlineCompletionRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10237,7 +10239,7 @@ pub struct TextDocumentInlineCompletionRequest { /// Response to the [TextDocumentInlineCompletionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentInlineCompletionResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10255,7 +10257,7 @@ pub struct TextDocumentInlineCompletionResponse { /// The `client/registerCapability` request is sent from the server to the client to register a new capability /// handler on the client side. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientRegisterCapabilityRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10271,7 +10273,7 @@ pub struct ClientRegisterCapabilityRequest { /// Response to the [ClientRegisterCapabilityRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientRegisterCapabilityResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10288,7 +10290,7 @@ pub struct ClientRegisterCapabilityResponse { /// The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability /// handler on the client side. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientUnregisterCapabilityRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10304,7 +10306,7 @@ pub struct ClientUnregisterCapabilityRequest { /// Response to the [ClientUnregisterCapabilityRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ClientUnregisterCapabilityResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10324,7 +10326,7 @@ pub struct ClientUnregisterCapabilityResponse { /// the response if of type [InitializeResult] of a Thenable that /// resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InitializeRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10340,7 +10342,7 @@ pub struct InitializeRequest { /// Response to the [InitializeRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct InitializeResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10359,7 +10361,7 @@ pub struct InitializeResponse { /// server. The only notification that is sent after a shutdown request /// is the exit event. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShutdownRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10373,7 +10375,7 @@ pub struct ShutdownRequest { /// Response to the [ShutdownRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct ShutdownResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10390,7 +10392,7 @@ pub struct ShutdownResponse { /// The show message request is sent from the server to the client to show a message /// and a set of options actions to the user. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowShowMessageRequestRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10406,7 +10408,7 @@ pub struct WindowShowMessageRequestRequest { /// Response to the [WindowShowMessageRequestRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WindowShowMessageRequestResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10428,7 +10430,7 @@ pub struct WindowShowMessageRequestResponse { /// server constantly fails on this request. This is done to keep the save fast and /// reliable. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentWillSaveWaitUntilRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10444,7 +10446,7 @@ pub struct TextDocumentWillSaveWaitUntilRequest { /// Response to the [TextDocumentWillSaveWaitUntilRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentWillSaveWaitUntilResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10469,7 +10471,7 @@ pub struct TextDocumentWillSaveWaitUntilResponse { /// request. However, properties that are needed for the initial sorting and filtering, like `sortText`, /// `filterText`, `insertText`, and `textEdit`, must not be changed during resolve. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentCompletionRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10485,7 +10487,7 @@ pub struct TextDocumentCompletionRequest { /// Response to the [TextDocumentCompletionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentCompletionResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10504,7 +10506,7 @@ pub struct TextDocumentCompletionResponse { /// parameter is of type [CompletionItem] the response /// is of type [CompletionItem] or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionItemResolveRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10520,7 +10522,7 @@ pub struct CompletionItemResolveRequest { /// Response to the [CompletionItemResolveRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CompletionItemResolveResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10538,7 +10540,7 @@ pub struct CompletionItemResolveResponse { /// parameter is of type [TextDocumentPosition] the response is of /// type [Hover] or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentHoverRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10554,7 +10556,7 @@ pub struct TextDocumentHoverRequest { /// Response to the [TextDocumentHoverRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentHoverResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10570,7 +10572,7 @@ pub struct TextDocumentHoverResponse { } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSignatureHelpRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10586,7 +10588,7 @@ pub struct TextDocumentSignatureHelpRequest { /// Response to the [TextDocumentSignatureHelpRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentSignatureHelpResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10606,7 +10608,7 @@ pub struct TextDocumentSignatureHelpResponse { /// the response is of either type [Definition] or a typed array of /// [DefinitionLink] or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDefinitionRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10622,7 +10624,7 @@ pub struct TextDocumentDefinitionRequest { /// Response to the [TextDocumentDefinitionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDefinitionResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10642,7 +10644,7 @@ pub struct TextDocumentDefinitionResponse { /// type [ReferenceParams] the response is of type /// {@link Location Location[]} or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentReferencesRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10658,7 +10660,7 @@ pub struct TextDocumentReferencesRequest { /// Response to the [TextDocumentReferencesRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentReferencesResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10678,7 +10680,7 @@ pub struct TextDocumentReferencesResponse { /// the request response is an array of type [DocumentHighlight] /// or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentHighlightRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10694,7 +10696,7 @@ pub struct TextDocumentDocumentHighlightRequest { /// Response to the [TextDocumentDocumentHighlightRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentHighlightResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10714,7 +10716,7 @@ pub struct TextDocumentDocumentHighlightResponse { /// response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable /// that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentSymbolRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10730,7 +10732,7 @@ pub struct TextDocumentDocumentSymbolRequest { /// Response to the [TextDocumentDocumentSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentSymbolResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10747,7 +10749,7 @@ pub struct TextDocumentDocumentSymbolResponse { /// A request to provide commands for the given text document and range. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentCodeActionRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10763,7 +10765,7 @@ pub struct TextDocumentCodeActionRequest { /// Response to the [TextDocumentCodeActionRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentCodeActionResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10782,7 +10784,7 @@ pub struct TextDocumentCodeActionResponse { /// parameter is of type [CodeAction] the response /// is of type [CodeAction] or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionResolveRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10798,7 +10800,7 @@ pub struct CodeActionResolveRequest { /// Response to the [CodeActionResolveRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeActionResolveResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10821,7 +10823,7 @@ pub struct CodeActionResolveResponse { /// need to advertise support for WorkspaceSymbols via the client capability /// `workspace.symbol.resolveSupport`. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10837,7 +10839,7 @@ pub struct WorkspaceSymbolRequest { /// Response to the [WorkspaceSymbolRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10857,7 +10859,7 @@ pub struct WorkspaceSymbolResponse { /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolResolveRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10873,7 +10875,7 @@ pub struct WorkspaceSymbolResolveRequest { /// Response to the [WorkspaceSymbolResolveRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceSymbolResolveResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10889,7 +10891,7 @@ pub struct WorkspaceSymbolResolveResponse { /// A request to provide code lens for the given text document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentCodeLensRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10905,7 +10907,7 @@ pub struct TextDocumentCodeLensRequest { /// Response to the [TextDocumentCodeLensRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentCodeLensResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10922,7 +10924,7 @@ pub struct TextDocumentCodeLensResponse { /// A request to resolve a command for a given code lens. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLensResolveRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10938,7 +10940,7 @@ pub struct CodeLensResolveRequest { /// Response to the [CodeLensResolveRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct CodeLensResolveResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10956,7 +10958,7 @@ pub struct CodeLensResolveResponse { /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceCodeLensRefreshRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10970,7 +10972,7 @@ pub struct WorkspaceCodeLensRefreshRequest { /// Response to the [WorkspaceCodeLensRefreshRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceCodeLensRefreshResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -10986,7 +10988,7 @@ pub struct WorkspaceCodeLensRefreshResponse { /// A request to provide document links #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentLinkRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11002,7 +11004,7 @@ pub struct TextDocumentDocumentLinkRequest { /// Response to the [TextDocumentDocumentLinkRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentDocumentLinkResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11021,7 +11023,7 @@ pub struct TextDocumentDocumentLinkResponse { /// parameter is of type [DocumentLink] the response /// is of type [DocumentLink] or a Thenable that resolves to such. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentLinkResolveRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11037,7 +11039,7 @@ pub struct DocumentLinkResolveRequest { /// Response to the [DocumentLinkResolveRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DocumentLinkResolveResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11053,7 +11055,7 @@ pub struct DocumentLinkResolveResponse { /// A request to format a whole document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentFormattingRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11069,7 +11071,7 @@ pub struct TextDocumentFormattingRequest { /// Response to the [TextDocumentFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentFormattingResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11086,7 +11088,7 @@ pub struct TextDocumentFormattingResponse { /// A request to format a range in a document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentRangeFormattingRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11102,7 +11104,7 @@ pub struct TextDocumentRangeFormattingRequest { /// Response to the [TextDocumentRangeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentRangeFormattingResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11123,7 +11125,7 @@ pub struct TextDocumentRangeFormattingResponse { /// @proposed #[cfg(feature = "proposed")] #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentRangesFormattingRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11139,7 +11141,7 @@ pub struct TextDocumentRangesFormattingRequest { /// Response to the [TextDocumentRangesFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentRangesFormattingResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11156,7 +11158,7 @@ pub struct TextDocumentRangesFormattingResponse { /// A request to format a document on type. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentOnTypeFormattingRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11172,7 +11174,7 @@ pub struct TextDocumentOnTypeFormattingRequest { /// Response to the [TextDocumentOnTypeFormattingRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentOnTypeFormattingResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11189,7 +11191,7 @@ pub struct TextDocumentOnTypeFormattingResponse { /// A request to rename a symbol. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentRenameRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11205,7 +11207,7 @@ pub struct TextDocumentRenameRequest { /// Response to the [TextDocumentRenameRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentRenameResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11224,7 +11226,7 @@ pub struct TextDocumentRenameResponse { /// /// @since 3.16 - support for default behavior #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPrepareRenameRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11240,7 +11242,7 @@ pub struct TextDocumentPrepareRenameRequest { /// Response to the [TextDocumentPrepareRenameRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct TextDocumentPrepareRenameResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11258,7 +11260,7 @@ pub struct TextDocumentPrepareRenameResponse { /// A request send from the client to the server to execute a command. The request might return /// a workspace edit which the client will apply to the workspace. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceExecuteCommandRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11274,7 +11276,7 @@ pub struct WorkspaceExecuteCommandRequest { /// Response to the [WorkspaceExecuteCommandRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceExecuteCommandResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11291,7 +11293,7 @@ pub struct WorkspaceExecuteCommandResponse { /// A request sent from the server to the client to modified certain resources. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceApplyEditRequest { /// The version of the JSON RPC protocol. pub jsonrpc: String, @@ -11307,7 +11309,7 @@ pub struct WorkspaceApplyEditRequest { /// Response to the [WorkspaceApplyEditRequest]. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] -#[serde(rename_all = "camelCase")] +#[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct WorkspaceApplyEditResponse { /// The version of the JSON RPC protocol. pub jsonrpc: String, diff --git a/tests/rust/src/main.rs b/tests/rust/src/main.rs index 4c24b25..8b5e9ea 100644 --- a/tests/rust/src/main.rs +++ b/tests/rust/src/main.rs @@ -21,23 +21,27 @@ mod tests { match serde_json::from_str::(data) { Ok(_) => assert_eq!( result_type, "True", - "Expected error, but succeeded deserializing" + "Expected error, but succeeded deserializing:\r\n{}", + data ), Err(e) => assert_eq!( - result_type, "False", - "Expected success, but failed deserializing: {e}", + result_type, + "False", + "Expected success, but failed deserializing: {}\r\nJSON data:\r\n{}", + e.to_string(), + data ), } } fn validate(lsp_type: &str, result_type: &str, data: &str) { + println!("Validating: {}", lsp_type); match lsp_type { - // Start of generated code - // Sample Generated Code: // "CallHierarchyIncomingCallsRequest" => { // return validate_type::(result_type, data) // } + // GENERATED_TEST_CODE:start "TextDocumentImplementationRequest" => { return validate_type::(result_type, data) } @@ -326,7 +330,7 @@ mod tests { "ProgressNotification" => { return validate_type::(result_type, data) } - // End of generated code + // GENERATED_TEST_CODE:end _ => (), } } @@ -350,7 +354,6 @@ mod tests { let type_name_result_type: Vec<&str> = basename.split("-").collect(); let lsp_type = type_name_result_type[0]; let result_type = type_name_result_type[1]; - println!("Validating: {}", json_file); let data = &fs::read_to_string(json_file.clone()).unwrap(); validate(&lsp_type, &result_type, &data); @@ -358,4 +361,10 @@ mod tests { } } -fn main() {} +fn main() { + // Use data from test error report here to debug + // let json_data = ""; + + // Update the type here to debug + // serde_json::from_str::(json_data).unwrap(); +} From a8d2a00a1d3ccd4bbeeb2c834245772919c596e9 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 15:09:02 -0800 Subject: [PATCH 15/27] Fix rust tests --- generator/plugins/rust/rust_commons.py | 7 ++- generator/plugins/rust/rust_structs.py | 44 ++++++++++--- packages/rust/lsprotocol/src/lib.rs | 85 +++++++++++++++++++++++++- 3 files changed, 124 insertions(+), 12 deletions(-) diff --git a/generator/plugins/rust/rust_commons.py b/generator/plugins/rust/rust_commons.py index b7cd798..9b2ec1a 100644 --- a/generator/plugins/rust/rust_commons.py +++ b/generator/plugins/rust/rust_commons.py @@ -324,7 +324,9 @@ def generate_extra_types(spec: model.LSPModel, type_data: TypeData) -> None: ), ) - direction = sorted(set([m.messageDirection for m in (spec.requests + spec.notifications)])) + direction = sorted( + set([m.messageDirection for m in (spec.requests + spec.notifications)]) + ) type_data.add_type_info( model.ReferenceType(kind="reference", name="MessageDirection"), "MessageDirection", @@ -380,7 +382,8 @@ def get_extended_properties( if t.kind == "reference": s = get_from_name(t.name, spec) if s: - properties += [p for p in s.properties] + s_props = get_extended_properties(s, spec) + properties += [p for p in s_props] elif t.kind == "literal": properties += [p for p in t.value.properties] else: diff --git a/generator/plugins/rust/rust_structs.py b/generator/plugins/rust/rust_structs.py index 0c5d231..9a69c39 100644 --- a/generator/plugins/rust/rust_structs.py +++ b/generator/plugins/rust/rust_structs.py @@ -12,6 +12,7 @@ generate_literal_struct_name, generate_property, get_extended_properties, + get_from_name, get_message_type_name, get_type_name, struct_wrapper, @@ -308,17 +309,28 @@ def generate_notification( ) -> None: properties = required_rpc_properties("LSPNotificationMethods") if notification_def.params: - properties += [ - model.Property( - name="params", - type=notification_def.params, - ) - ] + ptype = get_from_name(notification_def.params.name, spec) + if hasattr(ptype, "properties") and get_extended_properties(ptype, spec): + properties += [ + model.Property( + name="params", + type=notification_def.params, + ) + ] + else: + properties += [ + model.Property( + name="params", + type=model.ReferenceType(kind="reference", name="LSPAny"), + optional=True, + ) + ] else: properties += [ model.Property( name="params", type=model.ReferenceType(kind="reference", name="LSPNull"), + optional=True, ) ] @@ -388,10 +400,28 @@ def generate_request( ) ] if request_def.params: + ptype = get_from_name(request_def.params.name, spec) + if hasattr(ptype, "properties") and get_extended_properties(ptype, spec): + properties += [ + model.Property( + name="params", + type=request_def.params, + ) + ] + else: + properties += [ + model.Property( + name="params", + type=model.ReferenceType(kind="reference", name="LSPAny"), + optional=True, + ) + ] + else: properties += [ model.Property( name="params", - type=request_def.params, + type=model.ReferenceType(kind="reference", name="LSPNull"), + optional=True, ) ] diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index 30e0996..8f81eed 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -2073,6 +2073,8 @@ pub struct ImplementationRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -2103,6 +2105,8 @@ pub struct TypeDefinitionRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } /// A workspace folder inside a client. @@ -2169,6 +2173,8 @@ pub struct DocumentColorRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } /// Parameters for a [ColorPresentationRequest]. @@ -2284,6 +2290,8 @@ pub struct FoldingRangeRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -2314,6 +2322,8 @@ pub struct DeclarationRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } /// A parameter literal used in selection range requests. @@ -2345,6 +2355,8 @@ pub struct SelectionRangeRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -2425,6 +2437,8 @@ pub struct CallHierarchyRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } /// The parameter of a `callHierarchy/incomingCalls` request. @@ -2546,6 +2560,8 @@ pub struct SemanticTokensRegistrationOptions { /// Server supports providing semantic tokens for a specific range /// of a document. pub range: Option>, + + pub work_done_progress: Option, } /// @since 3.16.0 @@ -2679,6 +2695,8 @@ pub struct LinkedEditingRangeRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } /// The parameters sent in notifications/requests for user-initiated creation of @@ -2808,6 +2826,8 @@ pub struct MonikerRegistrationOptions { /// the document selector provided on the client side will be used. #[serde(skip_serializing_if = "Option::is_none")] pub document_selector: Option, + + pub work_done_progress: Option, } /// The parameter of a `textDocument/prepareTypeHierarchy` request. @@ -2875,6 +2895,8 @@ pub struct TypeHierarchyRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } /// The parameter of a `typeHierarchy/supertypes` request. @@ -2943,6 +2965,8 @@ pub struct InlineValueRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } /// A parameter literal used in inlay hint requests. @@ -3027,6 +3051,8 @@ pub struct InlayHintRegistrationOptions { /// The server provides support to resolve additional /// information for an inlay hint item. pub resolve_provider: Option, + + pub work_done_progress: Option, } /// Parameters of the document diagnostic request. @@ -3096,6 +3122,8 @@ pub struct DiagnosticRegistrationOptions { /// most programming languages and typically uncommon for linters. pub inter_file_dependencies: bool, + pub work_done_progress: Option, + /// The server provides support for workspace diagnostics as well. pub workspace_diagnostics: bool, } @@ -3276,6 +3304,8 @@ pub struct InlineCompletionRegistrationOptions { /// The id used to register the request. The id can be used to deregister /// the request again. See also Registration#id. pub id: Option, + + pub work_done_progress: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -3341,6 +3371,9 @@ pub struct InitializeParams { /// The initial trace setting. If omitted trace is disabled ('off'). pub trace: Option, + /// An optional token that a server can use to report work done progress. + pub work_done_token: Option, + /// The workspace folders configured in the client when the server starts. /// /// This property is only available if the client supports workspace folders. @@ -3805,6 +3838,8 @@ pub struct CompletionRegistrationOptions { /// If code complete should automatically be trigger on characters not being valid inside /// an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. pub trigger_characters: Option>, + + pub work_done_progress: Option, } /// Parameters for a [HoverRequest]. @@ -3841,6 +3876,8 @@ pub struct HoverRegistrationOptions { /// the document selector provided on the client side will be used. #[serde(skip_serializing_if = "Option::is_none")] pub document_selector: Option, + + pub work_done_progress: Option, } /// Parameters for a [SignatureHelpRequest]. @@ -3912,6 +3949,8 @@ pub struct SignatureHelpRegistrationOptions { /// List of characters that trigger signature help automatically. pub trigger_characters: Option>, + + pub work_done_progress: Option, } /// Parameters for a [DefinitionRequest]. @@ -3940,6 +3979,8 @@ pub struct DefinitionRegistrationOptions { /// the document selector provided on the client side will be used. #[serde(skip_serializing_if = "Option::is_none")] pub document_selector: Option, + + pub work_done_progress: Option, } /// Parameters for a [ReferencesRequest]. @@ -3970,6 +4011,8 @@ pub struct ReferenceRegistrationOptions { /// the document selector provided on the client side will be used. #[serde(skip_serializing_if = "Option::is_none")] pub document_selector: Option, + + pub work_done_progress: Option, } /// Parameters for a [DocumentHighlightRequest]. @@ -4011,6 +4054,8 @@ pub struct DocumentHighlightRegistrationOptions { /// the document selector provided on the client side will be used. #[serde(skip_serializing_if = "Option::is_none")] pub document_selector: Option, + + pub work_done_progress: Option, } /// Parameters for a [DocumentSymbolRequest]. @@ -4123,6 +4168,8 @@ pub struct DocumentSymbolRegistrationOptions { /// /// @since 3.16.0 pub label: Option, + + pub work_done_progress: Option, } /// The parameters of a [CodeActionRequest]. @@ -4243,6 +4290,8 @@ pub struct CodeActionRegistrationOptions { /// /// @since 3.16.0 pub resolve_provider: Option, + + pub work_done_progress: Option, } /// The parameters of a [WorkspaceSymbolRequest]. @@ -4307,6 +4356,8 @@ pub struct WorkspaceSymbolRegistrationOptions { /// /// @since 3.17.0 pub resolve_provider: Option, + + pub work_done_progress: Option, } /// The parameters of a [CodeLensRequest]. @@ -4354,6 +4405,8 @@ pub struct CodeLensRegistrationOptions { /// Code lens has a resolve provider as well. pub resolve_provider: Option, + + pub work_done_progress: Option, } /// The parameters of a [DocumentLinkRequest]. @@ -4407,6 +4460,8 @@ pub struct DocumentLinkRegistrationOptions { /// Document links have a resolve provider as well. pub resolve_provider: Option, + + pub work_done_progress: Option, } /// The parameters of a [DocumentFormattingRequest]. @@ -4431,6 +4486,8 @@ pub struct DocumentFormattingRegistrationOptions { /// the document selector provided on the client side will be used. #[serde(skip_serializing_if = "Option::is_none")] pub document_selector: Option, + + pub work_done_progress: Option, } /// The parameters of a [DocumentRangeFormattingRequest]. @@ -4465,6 +4522,8 @@ pub struct DocumentRangeFormattingRegistrationOptions { /// @proposed #[cfg(feature = "proposed")] pub ranges_support: Option, + + pub work_done_progress: Option, } /// The parameters of a [DocumentRangesFormattingRequest]. @@ -4558,6 +4617,8 @@ pub struct RenameRegistrationOptions { /// /// @since version 3.12.0 pub prepare_provider: Option, + + pub work_done_progress: Option, } #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -4593,6 +4654,8 @@ pub struct ExecuteCommandParams { pub struct ExecuteCommandRegistrationOptions { /// The commands to be executed on the server pub commands: Vec, + + pub work_done_progress: Option, } /// The parameters passed via an apply workspace edit request. @@ -8755,7 +8818,7 @@ pub struct InitializedNotification { /// The method to be invoked. pub method: LSPNotificationMethods, - pub params: InitializedParams, + pub params: Option, } /// The exit event is sent from the client to the server to @@ -8769,7 +8832,7 @@ pub struct ExitNotification { /// The method to be invoked. pub method: LSPNotificationMethods, - pub params: LSPNull, + pub params: Option, } /// The configuration change notification is sent from the client to the server @@ -8826,7 +8889,7 @@ pub struct TelemetryEventNotification { /// The method to be invoked. pub method: LSPNotificationMethods, - pub params: LSPAny, + pub params: Option, } /// The document open notification is sent from the client to the server to signal @@ -9085,6 +9148,8 @@ pub struct WorkspaceWorkspaceFoldersRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [WorkspaceWorkspaceFoldersRequest]. @@ -9262,6 +9327,8 @@ pub struct WorkspaceFoldingRangeRefreshRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [WorkspaceFoldingRangeRefreshRequest]. @@ -9602,6 +9669,8 @@ pub struct WorkspaceSemanticTokensRefreshRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [WorkspaceSemanticTokensRefreshRequest]. @@ -9994,6 +10063,8 @@ pub struct WorkspaceInlineValueRefreshRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [WorkspaceInlineValueRefreshRequest]. @@ -10097,6 +10168,8 @@ pub struct WorkspaceInlayHintRefreshRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [WorkspaceInlayHintRefreshRequest]. @@ -10197,6 +10270,8 @@ pub struct WorkspaceDiagnosticRefreshRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [WorkspaceDiagnosticRefreshRequest]. @@ -10371,6 +10446,8 @@ pub struct ShutdownRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [ShutdownRequest]. @@ -10968,6 +11045,8 @@ pub struct WorkspaceCodeLensRefreshRequest { /// The request id. pub id: LSPId, + + pub params: Option, } /// Response to the [WorkspaceCodeLensRefreshRequest]. From bb3ebd6bb75eaba8deaca7d0a7dfb01aa235d04d Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 15:09:11 -0800 Subject: [PATCH 16/27] Add dotnet sln --- lsprotocol.sln | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lsprotocol.sln diff --git a/lsprotocol.sln b/lsprotocol.sln new file mode 100644 index 0000000..5c88de0 --- /dev/null +++ b/lsprotocol.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packages", "packages", "{F7A4C27E-590F-4449-8CEA-EB9B6476ADDD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{7713486B-C956-4D98-81E1-057F80FB323C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "lsprotocol", "packages\dotnet\lsprotocol\lsprotocol.csproj", "{E40E6342-0ABD-4E41-98B5-E34CB2DEA0C2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{4E56DC3C-E33A-40F5-8082-778C0A1F6B2E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{D6F5BE34-11D4-4D75-ADCD-178D424AF26A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "lsprotocol_tests", "tests\dotnet\lsprotocol_tests\lsprotocol_tests.csproj", "{076D13A1-3EEA-4DD3-80C8-88E8D80E08C8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E40E6342-0ABD-4E41-98B5-E34CB2DEA0C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E40E6342-0ABD-4E41-98B5-E34CB2DEA0C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E40E6342-0ABD-4E41-98B5-E34CB2DEA0C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E40E6342-0ABD-4E41-98B5-E34CB2DEA0C2}.Release|Any CPU.Build.0 = Release|Any CPU + {076D13A1-3EEA-4DD3-80C8-88E8D80E08C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {076D13A1-3EEA-4DD3-80C8-88E8D80E08C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {076D13A1-3EEA-4DD3-80C8-88E8D80E08C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {076D13A1-3EEA-4DD3-80C8-88E8D80E08C8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {7713486B-C956-4D98-81E1-057F80FB323C} = {F7A4C27E-590F-4449-8CEA-EB9B6476ADDD} + {E40E6342-0ABD-4E41-98B5-E34CB2DEA0C2} = {7713486B-C956-4D98-81E1-057F80FB323C} + {D6F5BE34-11D4-4D75-ADCD-178D424AF26A} = {4E56DC3C-E33A-40F5-8082-778C0A1F6B2E} + {076D13A1-3EEA-4DD3-80C8-88E8D80E08C8} = {D6F5BE34-11D4-4D75-ADCD-178D424AF26A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {78EC86C0-D400-4662-BE12-33A046D3F565} + EndGlobalSection +EndGlobal From de3ca112411d6fd44b9404395bf92bd5c935c22b Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 17:03:21 -0800 Subject: [PATCH 17/27] Simplify test runner --- generator/plugins/rust/rust_tests.py | 3 +-- tests/rust/src/main.rs | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/generator/plugins/rust/rust_tests.py b/generator/plugins/rust/rust_tests.py index 5743f2f..df74e39 100644 --- a/generator/plugins/rust/rust_tests.py +++ b/generator/plugins/rust/rust_tests.py @@ -27,7 +27,6 @@ def generate_test_code(spec: model.LSPModel, test_path: pathlib.Path) -> str: "}", ] - code = test_path.read_text(encoding="utf-8").splitlines() start_marker = "GENERATED_TEST_CODE:start" end_marker = "GENERATED_TEST_CODE:end" @@ -36,7 +35,7 @@ def generate_test_code(spec: model.LSPModel, test_path: pathlib.Path) -> str: end_index = -1 for i, line in enumerate(code): if line.endswith(start_marker): - start_index = i+1 + start_index = i + 1 elif line.endswith(end_marker): end_index = i code[start_index:end_index] = lines diff --git a/tests/rust/src/main.rs b/tests/rust/src/main.rs index 8b5e9ea..eefc6df 100644 --- a/tests/rust/src/main.rs +++ b/tests/rust/src/main.rs @@ -335,6 +335,20 @@ mod tests { } } + fn validate_file(file_path: &str) { + let basename = std::path::Path::new(&file_path) + .file_name() + .unwrap() + .to_str() + .unwrap(); + let type_name_result_type: Vec<&str> = basename.split("-").collect(); + let lsp_type = type_name_result_type[0]; + let result_type = type_name_result_type[1]; + let data = &fs::read_to_string(file_path.clone()).unwrap(); + + validate(&lsp_type, &result_type, &data); + } + #[test] fn test_generated_data() { @@ -346,17 +360,7 @@ mod tests { .unwrap_or_else(|_| cwd.to_str().unwrap().to_string()); println!("TEST_DATA_ROOT: {}", env_value); for json_file in get_all_json_files(env_value.as_str()) { - let basename = std::path::Path::new(&json_file) - .file_name() - .unwrap() - .to_str() - .unwrap(); - let type_name_result_type: Vec<&str> = basename.split("-").collect(); - let lsp_type = type_name_result_type[0]; - let result_type = type_name_result_type[1]; - let data = &fs::read_to_string(json_file.clone()).unwrap(); - - validate(&lsp_type, &result_type, &data); + validate_file(&json_file); } } } From 02525f4f3848929f12f70ffe2a771dad9e1ff733 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 17:45:13 -0800 Subject: [PATCH 18/27] Update release pipelines --- azure-pipelines/release-pypi.yml | 4 +- azure-pipelines/release.yml | 36 ----------------- azure-pipelines/template/build_packages.yml | 31 --------------- azure-pipelines/template/publish_pypi.yml | 43 --------------------- noxfile.py | 2 +- 5 files changed, 3 insertions(+), 113 deletions(-) delete mode 100644 azure-pipelines/release.yml delete mode 100644 azure-pipelines/template/build_packages.yml delete mode 100644 azure-pipelines/template/publish_pypi.yml diff --git a/azure-pipelines/release-pypi.yml b/azure-pipelines/release-pypi.yml index 4b86065..e4ca40c 100644 --- a/azure-pipelines/release-pypi.yml +++ b/azure-pipelines/release-pypi.yml @@ -27,9 +27,9 @@ extends: - script: python -m pip install nox displayName: Install nox - - script: python -m nox --session build + - script: python -m nox --session build_python_package displayName: Build package (sdist and wheels) - publish: $(Build.SourcesDirectory)/packages/python/dist artifact: dist - displayName: 🚛 Publish artifact + displayName: 🚛 Publish pypi artifact diff --git a/azure-pipelines/release.yml b/azure-pipelines/release.yml deleted file mode 100644 index 6c12d7d..0000000 --- a/azure-pipelines/release.yml +++ /dev/null @@ -1,36 +0,0 @@ -trigger: none -pr: none - -variables: - Codeql.Enabled: true - -parameters: - - name: publishPyPI - displayName: 🚀 Publish To PyPI - type: string - values: [Skip, Test, Real] - default: Test - -stages: - - stage: pre_build - displayName: Pre-build validation - jobs: - - template: template/static_analysis.yml - - - stage: build - displayName: Build sdist and wheels - dependsOn: pre_build - variables: - skipComponentGovernanceDetection: true # handled by pre_build - jobs: - - template: template/build_packages.yml - - - stage: publish - displayName: Publish - dependsOn: build - variables: - skipComponentGovernanceDetection: true # handled by pre_build - jobs: - - template: template/publish_pypi.yml - parameters: - publishPyPI: ${{parameters.publishPyPI}} diff --git a/azure-pipelines/template/build_packages.yml b/azure-pipelines/template/build_packages.yml deleted file mode 100644 index 9f62cfd..0000000 --- a/azure-pipelines/template/build_packages.yml +++ /dev/null @@ -1,31 +0,0 @@ -jobs: - - job: BuildPkg - displayName: Build package - - pool: - vmImage: windows-latest - - steps: - - task: UsePythonVersion@0 - displayName: 'Use Python 3.8' - inputs: - versionSpec: 3.8 - - - script: python -m pip install -U pip - displayName: Upgrade Pip - - # For faster/better builds of sdists. - - script: python -m pip install wheel - displayName: Install build pre-requisite - - - script: python -m pip install nox - displayName: Install nox - - - script: python -m nox --session build - displayName: Build sdist and wheels - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact' - inputs: - pathToPublish: '$(Build.SourcesDirectory)/packages/python/dist' - artifactName: dist diff --git a/azure-pipelines/template/publish_pypi.yml b/azure-pipelines/template/publish_pypi.yml deleted file mode 100644 index 90f3e1d..0000000 --- a/azure-pipelines/template/publish_pypi.yml +++ /dev/null @@ -1,43 +0,0 @@ -parameters: - - name: publishPyPI - displayName: 🚀 Publish To PyPI - type: string - -jobs: - - job: PublishPkg - displayName: Publish Packages - - pool: - vmImage: windows-latest - - steps: - - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' - inputs: - artifactName: dist - targetPath: '$(Build.SourcesDirectory)/dist' - - - task: UsePythonVersion@0 - displayName: 'Use Python 3.8' - inputs: - versionSpec: 3.8 - - - script: python -m pip install -U pip - displayName: Upgrade Pip - - - script: python -m pip install twine - displayName: Install Twine - - - ${{ if eq(parameters.publishPyPI, 'Test') }}: - - script: python -m twine upload -r testpypi dist/* - displayName: Publish to Test PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: $(test_pypi_token) - - - ${{ if eq(parameters.publishPyPI, 'Real') }}: - - script: python -m twine upload dist/* - displayName: Publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: $(real_pypi_token) diff --git a/noxfile.py b/noxfile.py index c9ce745..d6804a4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -74,7 +74,7 @@ def _format_code(session: nox.Session): @nox.session() -def build(session: nox.Session): +def build_python_package(session: nox.Session): """Build lsprotocol (python) package for PyPI.""" session.install("flit") with session.chdir("./packages/python"): From c0e04959dfadf3c667a04bbeb9efa3595f9c1daf Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 17:54:25 -0800 Subject: [PATCH 19/27] fix workflows --- .github/workflows/pr-check.yml | 4 ++-- .github/workflows/push-check.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 54b78be..db7a74a 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -28,8 +28,8 @@ jobs: run: python -m pip install nox shell: bash - - name: Build sdist and wheels - run: python -m nox --session build + - name: Build pypi package + run: python -m nox --session build_python_package shell: bash - name: Upload Python Packages to Artifacts diff --git a/.github/workflows/push-check.yml b/.github/workflows/push-check.yml index 2062610..d57d99b 100644 --- a/.github/workflows/push-check.yml +++ b/.github/workflows/push-check.yml @@ -34,7 +34,7 @@ jobs: shell: bash - name: Build sdist and wheels - run: python -m nox --session build + run: python -m nox --session build_python_package shell: bash - name: Upload Python Packages to Artifacts From 19cb6419c851e51fec14cb2f5d2c829acf7d0334 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 19:03:14 -0800 Subject: [PATCH 20/27] Rebase with main --- packages/python/lsprotocol/types.py | 13120 ++++++++++++++++++++++++++ 1 file changed, 13120 insertions(+) diff --git a/packages/python/lsprotocol/types.py b/packages/python/lsprotocol/types.py index e69de29..dfa0dec 100644 --- a/packages/python/lsprotocol/types.py +++ b/packages/python/lsprotocol/types.py @@ -0,0 +1,13120 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# ****** THIS IS A GENERATED FILE, DO NOT EDIT. ****** +# Steps to generate: +# 1. Checkout https://github.com/microsoft/lsprotocol +# 2. Install nox: `python -m pip install nox` +# 3. Run command: `python -m nox --session build_lsp` + +import enum +import functools +from typing import Any, Dict, Optional, Sequence, Tuple, Union + +import attrs + +from . import validators + +__lsp_version__ = "3.17.0" + + +@enum.unique +class SemanticTokenTypes(str, enum.Enum): + """A set of predefined token types. This set is not fixed + an clients can specify additional token types via the + corresponding client capabilities. + + @since 3.16.0""" + + # Since: 3.16.0 + Namespace = "namespace" + Type = "type" + """Represents a generic type. Acts as a fallback for types which can't be mapped to + a specific type like class or enum.""" + Class = "class" + Enum = "enum" + Interface = "interface" + Struct = "struct" + TypeParameter = "typeParameter" + Parameter = "parameter" + Variable = "variable" + Property = "property" + EnumMember = "enumMember" + Event = "event" + Function = "function" + Method = "method" + Macro = "macro" + Keyword = "keyword" + Modifier = "modifier" + Comment = "comment" + String = "string" + Number = "number" + Regexp = "regexp" + Operator = "operator" + Decorator = "decorator" + """@since 3.17.0""" + # Since: 3.17.0 + + +@enum.unique +class SemanticTokenModifiers(str, enum.Enum): + """A set of predefined token modifiers. This set is not fixed + an clients can specify additional token types via the + corresponding client capabilities. + + @since 3.16.0""" + + # Since: 3.16.0 + Declaration = "declaration" + Definition = "definition" + Readonly = "readonly" + Static = "static" + Deprecated = "deprecated" + Abstract = "abstract" + Async = "async" + Modification = "modification" + Documentation = "documentation" + DefaultLibrary = "defaultLibrary" + + +@enum.unique +class DocumentDiagnosticReportKind(str, enum.Enum): + """The document diagnostic report kinds. + + @since 3.17.0""" + + # Since: 3.17.0 + Full = "full" + """A diagnostic report with a full + set of problems.""" + Unchanged = "unchanged" + """A report indicating that the last + returned report is still accurate.""" + + +class ErrorCodes(int, enum.Enum): + """Predefined error codes.""" + + ParseError = -32700 + InvalidRequest = -32600 + MethodNotFound = -32601 + InvalidParams = -32602 + InternalError = -32603 + ServerNotInitialized = -32002 + """Error code indicating that a server received a notification or + request before the server has received the `initialize` request.""" + UnknownErrorCode = -32001 + + +class LSPErrorCodes(int, enum.Enum): + RequestFailed = -32803 + """A request failed but it was syntactically correct, e.g the + method name was known and the parameters were valid. The error + message should contain human readable information about why + the request failed. + + @since 3.17.0""" + # Since: 3.17.0 + ServerCancelled = -32802 + """The server cancelled the request. This error code should + only be used for requests that explicitly support being + server cancellable. + + @since 3.17.0""" + # Since: 3.17.0 + ContentModified = -32801 + """The server detected that the content of a document got + modified outside normal conditions. A server should + NOT send this error code if it detects a content change + in it unprocessed messages. The result even computed + on an older state might still be useful for the client. + + If a client decides that a result is not of any use anymore + the client should cancel the request.""" + RequestCancelled = -32800 + """The client has canceled a request and a server as detected + the cancel.""" + + +@enum.unique +class FoldingRangeKind(str, enum.Enum): + """A set of predefined range kinds.""" + + Comment = "comment" + """Folding range for a comment""" + Imports = "imports" + """Folding range for an import or include""" + Region = "region" + """Folding range for a region (e.g. `#region`)""" + + +@enum.unique +class SymbolKind(int, enum.Enum): + """A symbol kind.""" + + File = 1 + Module = 2 + Namespace = 3 + Package = 4 + Class = 5 + Method = 6 + Property = 7 + Field = 8 + Constructor = 9 + Enum = 10 + Interface = 11 + Function = 12 + Variable = 13 + Constant = 14 + String = 15 + Number = 16 + Boolean = 17 + Array = 18 + Object = 19 + Key = 20 + Null = 21 + EnumMember = 22 + Struct = 23 + Event = 24 + Operator = 25 + TypeParameter = 26 + + +@enum.unique +class SymbolTag(int, enum.Enum): + """Symbol tags are extra annotations that tweak the rendering of a symbol. + + @since 3.16""" + + # Since: 3.16 + Deprecated = 1 + """Render a symbol as obsolete, usually using a strike-out.""" + + +@enum.unique +class UniquenessLevel(str, enum.Enum): + """Moniker uniqueness level to define scope of the moniker. + + @since 3.16.0""" + + # Since: 3.16.0 + Document = "document" + """The moniker is only unique inside a document""" + Project = "project" + """The moniker is unique inside a project for which a dump got created""" + Group = "group" + """The moniker is unique inside the group to which a project belongs""" + Scheme = "scheme" + """The moniker is unique inside the moniker scheme.""" + Global = "global" + """The moniker is globally unique""" + + +@enum.unique +class MonikerKind(str, enum.Enum): + """The moniker kind. + + @since 3.16.0""" + + # Since: 3.16.0 + Import = "import" + """The moniker represent a symbol that is imported into a project""" + Export = "export" + """The moniker represents a symbol that is exported from a project""" + Local = "local" + """The moniker represents a symbol that is local to a project (e.g. a local + variable of a function, a class not visible outside the project, ...)""" + + +@enum.unique +class InlayHintKind(int, enum.Enum): + """Inlay hint kinds. + + @since 3.17.0""" + + # Since: 3.17.0 + Type = 1 + """An inlay hint that for a type annotation.""" + Parameter = 2 + """An inlay hint that is for a parameter.""" + + +@enum.unique +class MessageType(int, enum.Enum): + """The message type""" + + Error = 1 + """An error message.""" + Warning = 2 + """A warning message.""" + Info = 3 + """An information message.""" + Log = 4 + """A log message.""" + Debug = 5 + """A debug message. + + @since 3.18.0""" + # Since: 3.18.0 + + +@enum.unique +class TextDocumentSyncKind(int, enum.Enum): + """Defines how the host (editor) should sync + document changes to the language server.""" + + None_ = 0 + """Documents should not be synced at all.""" + Full = 1 + """Documents are synced by always sending the full content + of the document.""" + Incremental = 2 + """Documents are synced by sending the full content on open. + After that only incremental updates to the document are + send.""" + + +@enum.unique +class TextDocumentSaveReason(int, enum.Enum): + """Represents reasons why a text document is saved.""" + + Manual = 1 + """Manually triggered, e.g. by the user pressing save, by starting debugging, + or by an API call.""" + AfterDelay = 2 + """Automatic after a delay.""" + FocusOut = 3 + """When the editor lost focus.""" + + +@enum.unique +class CompletionItemKind(int, enum.Enum): + """The kind of a completion entry.""" + + Text = 1 + Method = 2 + Function = 3 + Constructor = 4 + Field = 5 + Variable = 6 + Class = 7 + Interface = 8 + Module = 9 + Property = 10 + Unit = 11 + Value = 12 + Enum = 13 + Keyword = 14 + Snippet = 15 + Color = 16 + File = 17 + Reference = 18 + Folder = 19 + EnumMember = 20 + Constant = 21 + Struct = 22 + Event = 23 + Operator = 24 + TypeParameter = 25 + + +@enum.unique +class CompletionItemTag(int, enum.Enum): + """Completion item tags are extra annotations that tweak the rendering of a completion + item. + + @since 3.15.0""" + + # Since: 3.15.0 + Deprecated = 1 + """Render a completion as obsolete, usually using a strike-out.""" + + +@enum.unique +class InsertTextFormat(int, enum.Enum): + """Defines whether the insert text in a completion item should be interpreted as + plain text or a snippet.""" + + PlainText = 1 + """The primary text to be inserted is treated as a plain string.""" + Snippet = 2 + """The primary text to be inserted is treated as a snippet. + + A snippet can define tab stops and placeholders with `$1`, `$2` + and `${3:foo}`. `$0` defines the final tab stop, it defaults to + the end of the snippet. Placeholders with equal identifiers are linked, + that is typing in one will update others too. + + See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax""" + + +@enum.unique +class InsertTextMode(int, enum.Enum): + """How whitespace and indentation is handled during completion + item insertion. + + @since 3.16.0""" + + # Since: 3.16.0 + AsIs = 1 + """The insertion or replace strings is taken as it is. If the + value is multi line the lines below the cursor will be + inserted using the indentation defined in the string value. + The client will not apply any kind of adjustments to the + string.""" + AdjustIndentation = 2 + """The editor adjusts leading whitespace of new lines so that + they match the indentation up to the cursor of the line for + which the item is accepted. + + Consider a line like this: <2tabs><3tabs>foo. Accepting a + multi line completion item is indented using 2 tabs and all + following lines inserted will be indented using 2 tabs as well.""" + + +@enum.unique +class DocumentHighlightKind(int, enum.Enum): + """A document highlight kind.""" + + Text = 1 + """A textual occurrence.""" + Read = 2 + """Read-access of a symbol, like reading a variable.""" + Write = 3 + """Write-access of a symbol, like writing to a variable.""" + + +@enum.unique +class CodeActionKind(str, enum.Enum): + """A set of predefined code action kinds""" + + Empty = "" + """Empty kind.""" + QuickFix = "quickfix" + """Base kind for quickfix actions: 'quickfix'""" + Refactor = "refactor" + """Base kind for refactoring actions: 'refactor'""" + RefactorExtract = "refactor.extract" + """Base kind for refactoring extraction actions: 'refactor.extract' + + Example extract actions: + + - Extract method + - Extract function + - Extract variable + - Extract interface from class + - ...""" + RefactorInline = "refactor.inline" + """Base kind for refactoring inline actions: 'refactor.inline' + + Example inline actions: + + - Inline function + - Inline variable + - Inline constant + - ...""" + RefactorRewrite = "refactor.rewrite" + """Base kind for refactoring rewrite actions: 'refactor.rewrite' + + Example rewrite actions: + + - Convert JavaScript function to class + - Add or remove parameter + - Encapsulate field + - Make method static + - Move method to base class + - ...""" + Source = "source" + """Base kind for source actions: `source` + + Source code actions apply to the entire file.""" + SourceOrganizeImports = "source.organizeImports" + """Base kind for an organize imports source action: `source.organizeImports`""" + SourceFixAll = "source.fixAll" + """Base kind for auto-fix source actions: `source.fixAll`. + + Fix all actions automatically fix errors that have a clear fix that do not require user input. + They should not suppress errors or perform unsafe fixes such as generating new types or classes. + + @since 3.15.0""" + # Since: 3.15.0 + + +@enum.unique +class TraceValues(str, enum.Enum): + Off = "off" + """Turn tracing off.""" + Messages = "messages" + """Trace messages only.""" + Verbose = "verbose" + """Verbose message tracing.""" + + +@enum.unique +class MarkupKind(str, enum.Enum): + """Describes the content type that a client supports in various + result literals like `Hover`, `ParameterInfo` or `CompletionItem`. + + Please note that `MarkupKinds` must not start with a `$`. This kinds + are reserved for internal usage.""" + + PlainText = "plaintext" + """Plain text is supported as a content format""" + Markdown = "markdown" + """Markdown is supported as a content format""" + + +@enum.unique +class InlineCompletionTriggerKind(int, enum.Enum): + """Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + Invoked = 0 + """Completion was triggered explicitly by a user gesture.""" + Automatic = 1 + """Completion was triggered automatically while editing.""" + + +@enum.unique +class PositionEncodingKind(str, enum.Enum): + """A set of predefined position encoding kinds. + + @since 3.17.0""" + + # Since: 3.17.0 + Utf8 = "utf-8" + """Character offsets count UTF-8 code units (e.g. bytes).""" + Utf16 = "utf-16" + """Character offsets count UTF-16 code units. + + This is the default and must always be supported + by servers""" + Utf32 = "utf-32" + """Character offsets count UTF-32 code units. + + Implementation note: these are the same as Unicode codepoints, + so this `PositionEncodingKind` may also be used for an + encoding-agnostic representation of character offsets.""" + + +@enum.unique +class FileChangeType(int, enum.Enum): + """The file event type""" + + Created = 1 + """The file got created.""" + Changed = 2 + """The file got changed.""" + Deleted = 3 + """The file got deleted.""" + + +@enum.unique +class WatchKind(int, enum.Enum): + Create = 1 + """Interested in create events.""" + Change = 2 + """Interested in change events""" + Delete = 4 + """Interested in delete events""" + + +@enum.unique +class DiagnosticSeverity(int, enum.Enum): + """The diagnostic's severity.""" + + Error = 1 + """Reports an error.""" + Warning = 2 + """Reports a warning.""" + Information = 3 + """Reports an information.""" + Hint = 4 + """Reports a hint.""" + + +@enum.unique +class DiagnosticTag(int, enum.Enum): + """The diagnostic tags. + + @since 3.15.0""" + + # Since: 3.15.0 + Unnecessary = 1 + """Unused or unnecessary code. + + Clients are allowed to render diagnostics with this tag faded out instead of having + an error squiggle.""" + Deprecated = 2 + """Deprecated or obsolete code. + + Clients are allowed to rendered diagnostics with this tag strike through.""" + + +@enum.unique +class CompletionTriggerKind(int, enum.Enum): + """How a completion was triggered""" + + Invoked = 1 + """Completion was triggered by typing an identifier (24x7 code + complete), manual invocation (e.g Ctrl+Space) or via API.""" + TriggerCharacter = 2 + """Completion was triggered by a trigger character specified by + the `triggerCharacters` properties of the `CompletionRegistrationOptions`.""" + TriggerForIncompleteCompletions = 3 + """Completion was re-triggered as current completion list is incomplete""" + + +@enum.unique +class SignatureHelpTriggerKind(int, enum.Enum): + """How a signature help was triggered. + + @since 3.15.0""" + + # Since: 3.15.0 + Invoked = 1 + """Signature help was invoked manually by the user or by a command.""" + TriggerCharacter = 2 + """Signature help was triggered by a trigger character.""" + ContentChange = 3 + """Signature help was triggered by the cursor moving or by the document content changing.""" + + +@enum.unique +class CodeActionTriggerKind(int, enum.Enum): + """The reason why code actions were requested. + + @since 3.17.0""" + + # Since: 3.17.0 + Invoked = 1 + """Code actions were explicitly requested by the user or by an extension.""" + Automatic = 2 + """Code actions were requested automatically. + + This typically happens when current selection in a file changes, but can + also be triggered when file content changes.""" + + +@enum.unique +class FileOperationPatternKind(str, enum.Enum): + """A pattern kind describing if a glob pattern matches a file a folder or + both. + + @since 3.16.0""" + + # Since: 3.16.0 + File = "file" + """The pattern matches a file only.""" + Folder = "folder" + """The pattern matches a folder only.""" + + +@enum.unique +class NotebookCellKind(int, enum.Enum): + """A notebook cell kind. + + @since 3.17.0""" + + # Since: 3.17.0 + Markup = 1 + """A markup-cell is formatted source that is used for display.""" + Code = 2 + """A code-cell is source code.""" + + +@enum.unique +class ResourceOperationKind(str, enum.Enum): + Create = "create" + """Supports creating new files and folders.""" + Rename = "rename" + """Supports renaming existing files and folders.""" + Delete = "delete" + """Supports deleting existing files and folders.""" + + +@enum.unique +class FailureHandlingKind(str, enum.Enum): + Abort = "abort" + """Applying the workspace change is simply aborted if one of the changes provided + fails. All operations executed before the failing operation stay executed.""" + Transactional = "transactional" + """All operations are executed transactional. That means they either all + succeed or no changes at all are applied to the workspace.""" + TextOnlyTransactional = "textOnlyTransactional" + """If the workspace edit contains only textual file changes they are executed transactional. + If resource changes (create, rename or delete file) are part of the change the failure + handling strategy is abort.""" + Undo = "undo" + """The client tries to undo the operations already executed. But there is no + guarantee that this is succeeding.""" + + +@enum.unique +class PrepareSupportDefaultBehavior(int, enum.Enum): + Identifier = 1 + """The client's default behavior is to select the identifier + according the to language's syntax rule.""" + + +@enum.unique +class TokenFormat(str, enum.Enum): + Relative = "relative" + + +class LSPObject: + """LSP object definition. + @since 3.17.0""" + + # Since: 3.17.0 + pass + + +Definition = Union["Location", Sequence["Location"]] +"""The definition of a symbol represented as one or many {@link Location locations}. +For most programming languages there is only one location at which a symbol is +defined. + +Servers should prefer returning `DefinitionLink` over `Definition` if supported +by the client.""" + + +DefinitionLink = Union["LocationLink", "LocationLink"] +"""Information about where a symbol is defined. + +Provides additional metadata over normal {@link Location location} definitions, including the range of +the defining symbol""" + + +LSPArray = Sequence["LSPAny"] +"""LSP arrays. +@since 3.17.0""" +# Since: 3.17.0 + + +LSPAny = Union[Any, None] +"""The LSP any type. +Please note that strictly speaking a property with the value `undefined` +can't be converted into JSON preserving the property name. However for +convenience it is allowed and assumed that all these properties are +optional as well. +@since 3.17.0""" +# Since: 3.17.0 + + +Declaration = Union["Location", Sequence["Location"]] +"""The declaration of a symbol representation as one or many {@link Location locations}.""" + + +DeclarationLink = Union["LocationLink", "LocationLink"] +"""Information about where a symbol is declared. + +Provides additional metadata over normal {@link Location location} declarations, including the range of +the declaring symbol. + +Servers should prefer returning `DeclarationLink` over `Declaration` if supported +by the client.""" + + +InlineValue = Union[ + "InlineValueText", "InlineValueVariableLookup", "InlineValueEvaluatableExpression" +] +"""Inline value information can be provided by different means: +- directly as a text value (class InlineValueText). +- as a name to use for a variable lookup (class InlineValueVariableLookup) +- as an evaluatable expression (class InlineValueEvaluatableExpression) +The InlineValue types combines all inline value types into one type. + +@since 3.17.0""" +# Since: 3.17.0 + + +DocumentDiagnosticReport = Union[ + "RelatedFullDocumentDiagnosticReport", "RelatedUnchangedDocumentDiagnosticReport" +] +"""The result of a document diagnostic pull request. A report can +either be a full report containing all diagnostics for the +requested document or an unchanged report indicating that nothing +has changed in terms of diagnostics in comparison to the last +pull request. + +@since 3.17.0""" +# Since: 3.17.0 + + +PrepareRenameResult = Union[ + "Range", "PrepareRenamePlaceholder", "PrepareRenameDefaultBehavior" +] + + +DocumentSelector = Sequence["DocumentFilter"] +"""A document selector is the combination of one or many document filters. + +@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**/tsconfig.json' }]`; + +The use of a string as a document filter is deprecated @since 3.16.0.""" +# Since: 3.16.0. + + +ProgressToken = Union[int, str] + + +ChangeAnnotationIdentifier = str +"""An identifier to refer to a change annotation stored with a workspace edit.""" + + +WorkspaceDocumentDiagnosticReport = Union[ + "WorkspaceFullDocumentDiagnosticReport", + "WorkspaceUnchangedDocumentDiagnosticReport", +] +"""A workspace diagnostic document report. + +@since 3.17.0""" +# Since: 3.17.0 + + +TextDocumentContentChangeEvent = Union[ + "TextDocumentContentChangePartial", "TextDocumentContentChangeWholeDocument" +] +"""An event describing a change to a text document. If only a text is provided +it is considered to be the full content of the document.""" + + +MarkedString = Union[str, "MarkedStringWithLanguage"] +"""MarkedString can be used to render human readable text. It is either a markdown string +or a code-block that provides a language and a code snippet. The language identifier +is semantically equal to the optional language identifier in fenced code blocks in GitHub +issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting + +The pair of a language and a value is an equivalent to markdown: +```${language} +${value} +``` + +Note that markdown strings will be sanitized - that means html will be escaped. +@deprecated use MarkupContent instead.""" + + +DocumentFilter = Union["TextDocumentFilter", "NotebookCellTextDocumentFilter"] +"""A document filter describes a top level text document or +a notebook cell document. + +@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.""" +# Since: 3.17.0 - proposed support for NotebookCellTextDocumentFilter. + + +GlobPattern = Union["Pattern", "RelativePattern"] +"""The glob pattern. Either a string pattern or a relative pattern. + +@since 3.17.0""" +# Since: 3.17.0 + + +TextDocumentFilter = Union[ + "TextDocumentFilterLanguage", + "TextDocumentFilterScheme", + "TextDocumentFilterPattern", +] +"""A document filter denotes a document by different properties like +the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of +its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}. + +Glob patterns can have the following syntax: +- `*` to match one or more characters in a path segment +- `?` to match on one character in a path segment +- `**` to match any number of path segments, including none +- `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files) +- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) +- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) + +@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` +@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }` + +@since 3.17.0""" +# Since: 3.17.0 + + +Pattern = str +"""The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: +- `*` to match one or more characters in a path segment +- `?` to match on one character in a path segment +- `**` to match any number of path segments, including none +- `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files) +- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) +- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) + +@since 3.17.0""" +# Since: 3.17.0 + + +NotebookDocumentFilter = Union[ + "NotebookDocumentFilterNotebookType", + "NotebookDocumentFilterScheme", + "NotebookDocumentFilterPattern", +] +"""A notebook document filter denotes a notebook document by +different properties. The properties will be match +against the notebook's URI (same as with documents) + +@since 3.17.0""" +# Since: 3.17.0 + + +@attrs.define +class TextDocumentPositionParams: + """A parameter literal used in requests to pass a text document and a position inside that + document.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + +@attrs.define +class WorkDoneProgressParams: + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class PartialResultParams: + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class ImplementationParams: + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class Location: + """Represents a location inside a resource, such as a line + inside a text file.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + + range: "Range" = attrs.field() + + def __eq__(self, o: object) -> bool: + if not isinstance(o, Location): + return NotImplemented + return (self.uri == o.uri) and (self.range == o.range) + + def __repr__(self) -> str: + return f"{self.uri}:{self.range!r}" + + +@attrs.define +class TextDocumentRegistrationOptions: + """General text document registration options.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + +@attrs.define +class WorkDoneProgressOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class ImplementationOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class StaticRegistrationOptions: + """Static registration options to be returned in the initialize + request.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class ImplementationRegistrationOptions: + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class TypeDefinitionParams: + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class TypeDefinitionOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class TypeDefinitionRegistrationOptions: + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class WorkspaceFolder: + """A workspace folder inside a client.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The associated URI for this workspace folder.""" + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of the workspace folder. Used to refer to this + workspace folder in the user interface.""" + + +@attrs.define +class DidChangeWorkspaceFoldersParams: + """The parameters of a `workspace/didChangeWorkspaceFolders` notification.""" + + event: "WorkspaceFoldersChangeEvent" = attrs.field() + """The actual workspace folder change event.""" + + +@attrs.define +class ConfigurationParams: + """The parameters of a configuration request.""" + + items: Sequence["ConfigurationItem"] = attrs.field() + + +@attrs.define +class DocumentColorParams: + """Parameters for a {@link DocumentColorRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class ColorInformation: + """Represents a color range from a document.""" + + range: "Range" = attrs.field() + """The range in the document where this color appears.""" + + color: "Color" = attrs.field() + """The actual color value for this color range.""" + + +@attrs.define +class DocumentColorOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentColorRegistrationOptions: + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class ColorPresentationParams: + """Parameters for a {@link ColorPresentationRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + color: "Color" = attrs.field() + """The color to request presentations for.""" + + range: "Range" = attrs.field() + """The range where the color would be inserted. Serves as a context.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class ColorPresentation: + label: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The label of this color presentation. It will be shown on the color + picker header. By default this is also the text that is inserted when selecting + this color presentation.""" + + text_edit: Optional["TextEdit"] = attrs.field(default=None) + """An {@link TextEdit edit} which is applied to a document when selecting + this presentation for the color. When `falsy` the {@link ColorPresentation.label label} + is used.""" + + additional_text_edits: Optional[Sequence["TextEdit"]] = attrs.field(default=None) + """An optional array of additional {@link TextEdit text edits} that are applied when + selecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves.""" + + +@attrs.define +class FoldingRangeParams: + """Parameters for a {@link FoldingRangeRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class FoldingRange: + """Represents a folding range. To be valid, start and end line must be bigger than zero and smaller + than the number of lines in the document. Clients are free to ignore invalid ranges. + """ + + start_line: int = attrs.field(validator=validators.uinteger_validator) + """The zero-based start line of the range to fold. The folded area starts after the line's last character. + To be valid, the end must be zero or larger and smaller than the number of lines in the document.""" + + end_line: int = attrs.field(validator=validators.uinteger_validator) + """The zero-based end line of the range to fold. The folded area ends with the line's last character. + To be valid, the end must be zero or larger and smaller than the number of lines in the document.""" + + start_character: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.""" + + end_character: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.""" + + kind: Optional[Union[FoldingRangeKind, str]] = attrs.field(default=None) + """Describes the kind of the folding range such as `comment' or 'region'. The kind + is used to categorize folding ranges and used by commands like 'Fold all comments'. + See {@link FoldingRangeKind} for an enumeration of standardized kinds.""" + + collapsed_text: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The text that the client should show when the specified range is + collapsed. If not defined or not supported by the client, a default + will be chosen by the client. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class FoldingRangeOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class FoldingRangeRegistrationOptions: + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class DeclarationParams: + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class DeclarationOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DeclarationRegistrationOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class SelectionRangeParams: + """A parameter literal used in selection range requests.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + positions: Sequence["Position"] = attrs.field() + """The positions inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class SelectionRange: + """A selection range represents a part of a selection hierarchy. A selection range + may have a parent selection range that contains it.""" + + range: "Range" = attrs.field() + """The {@link Range range} of this selection range.""" + + parent: Optional["SelectionRange"] = attrs.field(default=None) + """The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.""" + + +@attrs.define +class SelectionRangeOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class SelectionRangeRegistrationOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class WorkDoneProgressCreateParams: + token: ProgressToken = attrs.field() + """The token to be used to report progress.""" + + +@attrs.define +class WorkDoneProgressCancelParams: + token: ProgressToken = attrs.field() + """The token to be used to report progress.""" + + +@attrs.define +class CallHierarchyPrepareParams: + """The parameter of a `textDocument/prepareCallHierarchy` request. + + @since 3.16.0""" + + # Since: 3.16.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class CallHierarchyItem: + """Represents programming constructs like functions or constructors in the context + of call hierarchy. + + @since 3.16.0""" + + # Since: 3.16.0 + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of this item.""" + + kind: SymbolKind = attrs.field() + """The kind of this item.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The resource identifier of this item.""" + + range: "Range" = attrs.field() + """The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.""" + + selection_range: "Range" = attrs.field() + """The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. + Must be contained by the {@link CallHierarchyItem.range `range`}.""" + + tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) + """Tags for this item.""" + + detail: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """More detail for this item, e.g. the signature of a function.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved between a call hierarchy prepare and + incoming calls or outgoing calls requests.""" + + +@attrs.define +class CallHierarchyOptions: + """Call hierarchy options used during static registration. + + @since 3.16.0""" + + # Since: 3.16.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class CallHierarchyRegistrationOptions: + """Call hierarchy options used during static or dynamic registration. + + @since 3.16.0""" + + # Since: 3.16.0 + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class CallHierarchyIncomingCallsParams: + """The parameter of a `callHierarchy/incomingCalls` request. + + @since 3.16.0""" + + # Since: 3.16.0 + + item: CallHierarchyItem = attrs.field() + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class CallHierarchyIncomingCall: + """Represents an incoming call, e.g. a caller of a method or constructor. + + @since 3.16.0""" + + # Since: 3.16.0 + + from_: CallHierarchyItem = attrs.field() + """The item that makes the call.""" + + from_ranges: Sequence["Range"] = attrs.field() + """The ranges at which the calls appear. This is relative to the caller + denoted by {@link CallHierarchyIncomingCall.from `this.from`}.""" + + +@attrs.define +class CallHierarchyOutgoingCallsParams: + """The parameter of a `callHierarchy/outgoingCalls` request. + + @since 3.16.0""" + + # Since: 3.16.0 + + item: CallHierarchyItem = attrs.field() + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class CallHierarchyOutgoingCall: + """Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc. + + @since 3.16.0""" + + # Since: 3.16.0 + + to: CallHierarchyItem = attrs.field() + """The item that is called.""" + + from_ranges: Sequence["Range"] = attrs.field() + """The range at which this item is called. This is the range relative to the caller, e.g the item + passed to {@link CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls `provideCallHierarchyOutgoingCalls`} + and not {@link CallHierarchyOutgoingCall.to `this.to`}.""" + + +@attrs.define +class SemanticTokensParams: + """@since 3.16.0""" + + # Since: 3.16.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class SemanticTokens: + """@since 3.16.0""" + + # Since: 3.16.0 + + data: Sequence[int] = attrs.field() + """The actual tokens.""" + + result_id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional result id. If provided and clients support delta updating + the client will include the result id in the next semantic token request. + A server can then instead of computing all semantic tokens again simply + send a delta.""" + + +@attrs.define +class SemanticTokensPartialResult: + """@since 3.16.0""" + + # Since: 3.16.0 + + data: Sequence[int] = attrs.field() + + +@attrs.define +class SemanticTokensOptions: + """@since 3.16.0""" + + # Since: 3.16.0 + + legend: "SemanticTokensLegend" = attrs.field() + """The legend used by the server""" + + range: Optional[Union[bool, Any]] = attrs.field(default=None) + """Server supports providing semantic tokens for a specific range + of a document.""" + + full: Optional[Union[bool, "SemanticTokensFullDelta"]] = attrs.field(default=None) + """Server supports providing semantic tokens for a full document.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class SemanticTokensRegistrationOptions: + """@since 3.16.0""" + + # Since: 3.16.0 + + legend: "SemanticTokensLegend" = attrs.field() + """The legend used by the server""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + range: Optional[Union[bool, Any]] = attrs.field(default=None) + """Server supports providing semantic tokens for a specific range + of a document.""" + + full: Optional[Union[bool, "SemanticTokensFullDelta"]] = attrs.field(default=None) + """Server supports providing semantic tokens for a full document.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class SemanticTokensDeltaParams: + """@since 3.16.0""" + + # Since: 3.16.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + previous_result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The result id of a previous response. The result Id can either point to a full response + or a delta response depending on what was received last.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class SemanticTokensDelta: + """@since 3.16.0""" + + # Since: 3.16.0 + + edits: Sequence["SemanticTokensEdit"] = attrs.field() + """The semantic token edits to transform a previous result into a new result.""" + + result_id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + + +@attrs.define +class SemanticTokensDeltaPartialResult: + """@since 3.16.0""" + + # Since: 3.16.0 + + edits: Sequence["SemanticTokensEdit"] = attrs.field() + + +@attrs.define +class SemanticTokensRangeParams: + """@since 3.16.0""" + + # Since: 3.16.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + range: "Range" = attrs.field() + """The range the semantic tokens are requested for.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class ShowDocumentParams: + """Params to show a resource in the UI. + + @since 3.16.0""" + + # Since: 3.16.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The uri to show.""" + + external: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Indicates to show the resource in an external program. + To show, for example, `https://code.visualstudio.com/` + in the default WEB browser set `external` to `true`.""" + + take_focus: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """An optional property to indicate whether the editor + showing the document should take focus or not. + Clients might ignore this property if an external + program is started.""" + + selection: Optional["Range"] = attrs.field(default=None) + """An optional selection range if the document is a text + document. Clients might ignore the property if an + external program is started or the file is not a text + file.""" + + +@attrs.define +class ShowDocumentResult: + """The result of a showDocument request. + + @since 3.16.0""" + + # Since: 3.16.0 + + success: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """A boolean indicating if the show was successful.""" + + +@attrs.define +class LinkedEditingRangeParams: + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class LinkedEditingRanges: + """The result of a linked editing range request. + + @since 3.16.0""" + + # Since: 3.16.0 + + ranges: Sequence["Range"] = attrs.field() + """A list of ranges that can be edited together. The ranges must have + identical length and contain identical text content. The ranges cannot overlap.""" + + word_pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional word pattern (regular expression) that describes valid contents for + the given ranges. If no pattern is provided, the client configuration's word + pattern will be used.""" + + +@attrs.define +class LinkedEditingRangeOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class LinkedEditingRangeRegistrationOptions: + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class CreateFilesParams: + """The parameters sent in notifications/requests for user-initiated creation of + files. + + @since 3.16.0""" + + # Since: 3.16.0 + + files: Sequence["FileCreate"] = attrs.field() + """An array of all files/folders created in this operation.""" + + +@attrs.define +class WorkspaceEdit: + """A workspace edit represents changes to many resources managed in the workspace. The edit + should either provide `changes` or `documentChanges`. If documentChanges are present + they are preferred over `changes` if the client can handle versioned document edits. + + Since version 3.13.0 a workspace edit can contain resource operations as well. If resource + operations are present clients need to execute the operations in the order in which they + are provided. So a workspace edit for example can consist of the following two changes: + (1) a create file a.txt and (2) a text document edit which insert text into file a.txt. + + An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will + cause failure of the operation. How the client recovers from the failure is described by + the client capability: `workspace.workspaceEdit.failureHandling`""" + + changes: Optional[Dict[str, Sequence["TextEdit"]]] = attrs.field(default=None) + """Holds changes to existing resources.""" + + document_changes: Optional[ + Sequence[Union["TextDocumentEdit", "CreateFile", "RenameFile", "DeleteFile"]] + ] = attrs.field(default=None) + """Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes + are either an array of `TextDocumentEdit`s to express changes to n different text documents + where each text document edit addresses a specific version of a text document. Or it can contain + above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations. + + Whether a client supports versioned document edits is expressed via + `workspace.workspaceEdit.documentChanges` client capability. + + If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then + only plain `TextEdit`s using the `changes` property are supported.""" + + change_annotations: Optional[ + Dict[ChangeAnnotationIdentifier, "ChangeAnnotation"] + ] = attrs.field(default=None) + """A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and + delete file / folder operations. + + Whether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class FileOperationRegistrationOptions: + """The options to register for file operations. + + @since 3.16.0""" + + # Since: 3.16.0 + + filters: Sequence["FileOperationFilter"] = attrs.field() + """The actual filters.""" + + +@attrs.define +class RenameFilesParams: + """The parameters sent in notifications/requests for user-initiated renames of + files. + + @since 3.16.0""" + + # Since: 3.16.0 + + files: Sequence["FileRename"] = attrs.field() + """An array of all files/folders renamed in this operation. When a folder is renamed, only + the folder will be included, and not its children.""" + + +@attrs.define +class DeleteFilesParams: + """The parameters sent in notifications/requests for user-initiated deletes of + files. + + @since 3.16.0""" + + # Since: 3.16.0 + + files: Sequence["FileDelete"] = attrs.field() + """An array of all files/folders deleted in this operation.""" + + +@attrs.define +class MonikerParams: + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class Moniker: + """Moniker definition to match LSIF 0.5 moniker definition. + + @since 3.16.0""" + + # Since: 3.16.0 + + scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The scheme of the moniker. For example tsc or .Net""" + + identifier: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The identifier of the moniker. The value is opaque in LSIF however + schema owners are allowed to define the structure if they want.""" + + unique: UniquenessLevel = attrs.field() + """The scope in which the moniker is unique""" + + kind: Optional[MonikerKind] = attrs.field(default=None) + """The moniker kind if known.""" + + +@attrs.define +class MonikerOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class MonikerRegistrationOptions: + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class TypeHierarchyPrepareParams: + """The parameter of a `textDocument/prepareTypeHierarchy` request. + + @since 3.17.0""" + + # Since: 3.17.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class TypeHierarchyItem: + """@since 3.17.0""" + + # Since: 3.17.0 + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of this item.""" + + kind: SymbolKind = attrs.field() + """The kind of this item.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The resource identifier of this item.""" + + range: "Range" = attrs.field() + """The range enclosing this symbol not including leading/trailing whitespace + but everything else, e.g. comments and code.""" + + selection_range: "Range" = attrs.field() + """The range that should be selected and revealed when this symbol is being + picked, e.g. the name of a function. Must be contained by the + {@link TypeHierarchyItem.range `range`}.""" + + tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) + """Tags for this item.""" + + detail: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """More detail for this item, e.g. the signature of a function.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved between a type hierarchy prepare and + supertypes or subtypes requests. It could also be used to identify the + type hierarchy in the server, helping improve the performance on + resolving supertypes and subtypes.""" + + +@attrs.define +class TypeHierarchyOptions: + """Type hierarchy options used during static registration. + + @since 3.17.0""" + + # Since: 3.17.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class TypeHierarchyRegistrationOptions: + """Type hierarchy options used during static or dynamic registration. + + @since 3.17.0""" + + # Since: 3.17.0 + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class TypeHierarchySupertypesParams: + """The parameter of a `typeHierarchy/supertypes` request. + + @since 3.17.0""" + + # Since: 3.17.0 + + item: TypeHierarchyItem = attrs.field() + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class TypeHierarchySubtypesParams: + """The parameter of a `typeHierarchy/subtypes` request. + + @since 3.17.0""" + + # Since: 3.17.0 + + item: TypeHierarchyItem = attrs.field() + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class InlineValueParams: + """A parameter literal used in inline value requests. + + @since 3.17.0""" + + # Since: 3.17.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + range: "Range" = attrs.field() + """The document range for which inline values should be computed.""" + + context: "InlineValueContext" = attrs.field() + """Additional information about the context in which inline values were + requested.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class InlineValueOptions: + """Inline value options used during static registration. + + @since 3.17.0""" + + # Since: 3.17.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class InlineValueRegistrationOptions: + """Inline value options used during static or dynamic registration. + + @since 3.17.0""" + + # Since: 3.17.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class InlayHintParams: + """A parameter literal used in inlay hint requests. + + @since 3.17.0""" + + # Since: 3.17.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + range: "Range" = attrs.field() + """The document range for which inlay hints should be computed.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class InlayHint: + """Inlay hint information. + + @since 3.17.0""" + + # Since: 3.17.0 + + position: "Position" = attrs.field() + """The position of this hint.""" + + label: Union[str, Sequence["InlayHintLabelPart"]] = attrs.field() + """The label of this hint. A human readable string or an array of + InlayHintLabelPart label parts. + + *Note* that neither the string nor the label part can be empty.""" + + kind: Optional[InlayHintKind] = attrs.field(default=None) + """The kind of this hint. Can be omitted in which case the client + should fall back to a reasonable default.""" + + text_edits: Optional[Sequence["TextEdit"]] = attrs.field(default=None) + """Optional text edits that are performed when accepting this inlay hint. + + *Note* that edits are expected to change the document so that the inlay + hint (or its nearest variant) is now part of the document and the inlay + hint itself is now obsolete.""" + + tooltip: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) + """The tooltip text when you hover over this item.""" + + padding_left: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Render padding before the hint. + + Note: Padding should use the editor's background color, not the + background color of the hint itself. That means padding can be used + to visually align/separate an inlay hint.""" + + padding_right: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Render padding after the hint. + + Note: Padding should use the editor's background color, not the + background color of the hint itself. That means padding can be used + to visually align/separate an inlay hint.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved on an inlay hint between + a `textDocument/inlayHint` and a `inlayHint/resolve` request.""" + + +@attrs.define +class InlayHintOptions: + """Inlay hint options used during static registration. + + @since 3.17.0""" + + # Since: 3.17.0 + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for an inlay hint item.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class InlayHintRegistrationOptions: + """Inlay hint options used during static or dynamic registration. + + @since 3.17.0""" + + # Since: 3.17.0 + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for an inlay hint item.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class DocumentDiagnosticParams: + """Parameters of the document diagnostic request. + + @since 3.17.0""" + + # Since: 3.17.0 + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + identifier: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The additional identifier provided during registration.""" + + previous_result_id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The result id of a previous response if provided.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class DocumentDiagnosticReportPartialResult: + """A partial result for a document diagnostic report. + + @since 3.17.0""" + + # Since: 3.17.0 + + related_documents: Dict[ + str, Union["FullDocumentDiagnosticReport", "UnchangedDocumentDiagnosticReport"] + ] = attrs.field() + + +@attrs.define +class DiagnosticServerCancellationData: + """Cancellation data returned from a diagnostic request. + + @since 3.17.0""" + + # Since: 3.17.0 + + retrigger_request: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + + +@attrs.define +class DiagnosticOptions: + """Diagnostic options. + + @since 3.17.0""" + + # Since: 3.17.0 + + inter_file_dependencies: bool = attrs.field( + validator=attrs.validators.instance_of(bool) + ) + """Whether the language has inter file dependencies meaning that + editing code in one file can result in a different diagnostic + set in another file. Inter file dependencies are common for + most programming languages and typically uncommon for linters.""" + + workspace_diagnostics: bool = attrs.field( + validator=attrs.validators.instance_of(bool) + ) + """The server provides support for workspace diagnostics as well.""" + + identifier: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional identifier under which the diagnostics are + managed by the client.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DiagnosticRegistrationOptions: + """Diagnostic registration options. + + @since 3.17.0""" + + # Since: 3.17.0 + + inter_file_dependencies: bool = attrs.field( + validator=attrs.validators.instance_of(bool) + ) + """Whether the language has inter file dependencies meaning that + editing code in one file can result in a different diagnostic + set in another file. Inter file dependencies are common for + most programming languages and typically uncommon for linters.""" + + workspace_diagnostics: bool = attrs.field( + validator=attrs.validators.instance_of(bool) + ) + """The server provides support for workspace diagnostics as well.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + identifier: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional identifier under which the diagnostics are + managed by the client.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class WorkspaceDiagnosticParams: + """Parameters of the workspace diagnostic request. + + @since 3.17.0""" + + # Since: 3.17.0 + + previous_result_ids: Sequence["PreviousResultId"] = attrs.field() + """The currently known diagnostic reports with their + previous result ids.""" + + identifier: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The additional identifier provided during registration.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class WorkspaceDiagnosticReport: + """A workspace diagnostic report. + + @since 3.17.0""" + + # Since: 3.17.0 + + items: Sequence[WorkspaceDocumentDiagnosticReport] = attrs.field() + + +@attrs.define +class WorkspaceDiagnosticReportPartialResult: + """A partial result for a workspace diagnostic report. + + @since 3.17.0""" + + # Since: 3.17.0 + + items: Sequence[WorkspaceDocumentDiagnosticReport] = attrs.field() + + +@attrs.define +class DidOpenNotebookDocumentParams: + """The params sent in an open notebook document notification. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_document: "NotebookDocument" = attrs.field() + """The notebook document that got opened.""" + + cell_text_documents: Sequence["TextDocumentItem"] = attrs.field() + """The text documents that represent the content + of a notebook cell.""" + + +@attrs.define +class DidChangeNotebookDocumentParams: + """The params sent in a change notebook document notification. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_document: "VersionedNotebookDocumentIdentifier" = attrs.field() + """The notebook document that did change. The version number points + to the version after all provided changes have been applied. If + only the text document content of a cell changes the notebook version + doesn't necessarily have to change.""" + + change: "NotebookDocumentChangeEvent" = attrs.field() + """The actual changes to the notebook document. + + The changes describe single state changes to the notebook document. + So if there are two changes c1 (at array index 0) and c2 (at array + index 1) for a notebook in state S then c1 moves the notebook from + S to S' and c2 from S' to S''. So c1 is computed on the state S and + c2 is computed on the state S'. + + To mirror the content of a notebook using change events use the following approach: + - start with the same initial content + - apply the 'notebookDocument/didChange' notifications in the order you receive them. + - apply the `NotebookChangeEvent`s in a single notification in the order + you receive them.""" + + +@attrs.define +class DidSaveNotebookDocumentParams: + """The params sent in a save notebook document notification. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_document: "NotebookDocumentIdentifier" = attrs.field() + """The notebook document that got saved.""" + + +@attrs.define +class DidCloseNotebookDocumentParams: + """The params sent in a close notebook document notification. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_document: "NotebookDocumentIdentifier" = attrs.field() + """The notebook document that got closed.""" + + cell_text_documents: Sequence["TextDocumentIdentifier"] = attrs.field() + """The text documents that represent the content + of a notebook cell that got closed.""" + + +@attrs.define +class InlineCompletionParams: + """A parameter literal used in inline completion requests. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + context: "InlineCompletionContext" = attrs.field() + """Additional information about the context in which inline completions were + requested.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class InlineCompletionList: + """Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + items: Sequence["InlineCompletionItem"] = attrs.field() + """The inline completion items""" + + +@attrs.define +class InlineCompletionItem: + """An inline completion item represents a text snippet that is proposed inline to complete text that is being typed. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + insert_text: Union[str, "StringValue"] = attrs.field() + """The text to replace the range with. Must be set.""" + + filter_text: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used.""" + + range: Optional["Range"] = attrs.field(default=None) + """The range to replace. Must begin and end on the same line.""" + + command: Optional["Command"] = attrs.field(default=None) + """An optional {@link Command} that is executed *after* inserting this completion.""" + + +@attrs.define +class InlineCompletionOptions: + """Inline completion options used during static registration. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class InlineCompletionRegistrationOptions: + """Inline completion options used during static or dynamic registration. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class RegistrationParams: + registrations: Sequence["Registration"] = attrs.field() + + +@attrs.define +class UnregistrationParams: + unregisterations: Sequence["Unregistration"] = attrs.field() + + +@attrs.define +class _InitializeParams: + """The initialize parameters""" + + capabilities: "ClientCapabilities" = attrs.field() + """The capabilities provided by the client (editor or tool)""" + + process_id: Optional[Union[int, None]] = attrs.field(default=None) + """The process Id of the parent process that started + the server. + + Is `null` if the process has not been started by another process. + If the parent process is not alive then the server should exit.""" + + client_info: Optional["ClientInfo"] = attrs.field(default=None) + """Information about the client + + @since 3.15.0""" + # Since: 3.15.0 + + locale: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The locale the client is currently showing the user interface + in. This must not necessarily be the locale of the operating + system. + + Uses IETF language tags as the value's syntax + (See https://en.wikipedia.org/wiki/IETF_language_tag) + + @since 3.16.0""" + # Since: 3.16.0 + + root_path: Optional[Union[str, None]] = attrs.field(default=None) + """The rootPath of the workspace. Is null + if no folder is open. + + @deprecated in favour of rootUri.""" + + root_uri: Optional[Union[str, None]] = attrs.field(default=None) + """The rootUri of the workspace. Is null if no + folder is open. If both `rootPath` and `rootUri` are set + `rootUri` wins. + + @deprecated in favour of workspaceFolders.""" + + initialization_options: Optional[LSPAny] = attrs.field(default=None) + """User provided initialization options.""" + + trace: Optional[TraceValues] = attrs.field(default=None) + """The initial trace setting. If omitted trace is disabled ('off').""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class WorkspaceFoldersInitializeParams: + workspace_folders: Optional[Union[Sequence[WorkspaceFolder], None]] = attrs.field( + default=None + ) + """The workspace folders configured in the client when the server starts. + + This property is only available if the client supports workspace folders. + It can be `null` if the client supports workspace folders but none are + configured. + + @since 3.6.0""" + # Since: 3.6.0 + + +@attrs.define +class InitializeParams: + capabilities: "ClientCapabilities" = attrs.field() + """The capabilities provided by the client (editor or tool)""" + + process_id: Optional[Union[int, None]] = attrs.field(default=None) + """The process Id of the parent process that started + the server. + + Is `null` if the process has not been started by another process. + If the parent process is not alive then the server should exit.""" + + client_info: Optional["ClientInfo"] = attrs.field(default=None) + """Information about the client + + @since 3.15.0""" + # Since: 3.15.0 + + locale: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The locale the client is currently showing the user interface + in. This must not necessarily be the locale of the operating + system. + + Uses IETF language tags as the value's syntax + (See https://en.wikipedia.org/wiki/IETF_language_tag) + + @since 3.16.0""" + # Since: 3.16.0 + + root_path: Optional[Union[str, None]] = attrs.field(default=None) + """The rootPath of the workspace. Is null + if no folder is open. + + @deprecated in favour of rootUri.""" + + root_uri: Optional[Union[str, None]] = attrs.field(default=None) + """The rootUri of the workspace. Is null if no + folder is open. If both `rootPath` and `rootUri` are set + `rootUri` wins. + + @deprecated in favour of workspaceFolders.""" + + initialization_options: Optional[LSPAny] = attrs.field(default=None) + """User provided initialization options.""" + + trace: Optional[TraceValues] = attrs.field(default=None) + """The initial trace setting. If omitted trace is disabled ('off').""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + workspace_folders: Optional[Union[Sequence[WorkspaceFolder], None]] = attrs.field( + default=None + ) + """The workspace folders configured in the client when the server starts. + + This property is only available if the client supports workspace folders. + It can be `null` if the client supports workspace folders but none are + configured. + + @since 3.6.0""" + # Since: 3.6.0 + + +@attrs.define +class InitializeResult: + """The result returned from an initialize request.""" + + capabilities: "ServerCapabilities" = attrs.field() + """The capabilities the language server provides.""" + + server_info: Optional["ServerInfo"] = attrs.field(default=None) + """Information about the server. + + @since 3.15.0""" + # Since: 3.15.0 + + +@attrs.define +class InitializeError: + """The data type of the ResponseError if the + initialize request fails.""" + + retry: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """Indicates whether the client execute the following retry logic: + (1) show the message provided by the ResponseError to the user + (2) user selects retry or cancel + (3) if user selected retry the initialize method is sent again.""" + + +@attrs.define +class InitializedParams: + pass + + +@attrs.define +class DidChangeConfigurationParams: + """The parameters of a change configuration notification.""" + + settings: LSPAny = attrs.field() + """The actual changed settings""" + + +@attrs.define +class DidChangeConfigurationRegistrationOptions: + section: Optional[Union[str, Sequence[str]]] = attrs.field(default=None) + + +@attrs.define +class ShowMessageParams: + """The parameters of a notification message.""" + + type: MessageType = attrs.field() + """The message type. See {@link MessageType}""" + + message: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The actual message.""" + + +@attrs.define +class ShowMessageRequestParams: + type: MessageType = attrs.field() + """The message type. See {@link MessageType}""" + + message: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The actual message.""" + + actions: Optional[Sequence["MessageActionItem"]] = attrs.field(default=None) + """The message action items to present.""" + + +@attrs.define +class MessageActionItem: + title: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A short title like 'Retry', 'Open Log' etc.""" + + +@attrs.define +class LogMessageParams: + """The log message parameters.""" + + type: MessageType = attrs.field() + """The message type. See {@link MessageType}""" + + message: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The actual message.""" + + +@attrs.define +class DidOpenTextDocumentParams: + """The parameters sent in an open text document notification""" + + text_document: "TextDocumentItem" = attrs.field() + """The document that was opened.""" + + +@attrs.define +class DidChangeTextDocumentParams: + """The change text document notification's parameters.""" + + text_document: "VersionedTextDocumentIdentifier" = attrs.field() + """The document that did change. The version number points + to the version after all provided content changes have + been applied.""" + + content_changes: Sequence[TextDocumentContentChangeEvent] = attrs.field() + """The actual content changes. The content changes describe single state changes + to the document. So if there are two content changes c1 (at array index 0) and + c2 (at array index 1) for a document in state S then c1 moves the document from + S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed + on the state S'. + + To mirror the content of a document using change events use the following approach: + - start with the same initial content + - apply the 'textDocument/didChange' notifications in the order you receive them. + - apply the `TextDocumentContentChangeEvent`s in a single notification in the order + you receive them.""" + + +@attrs.define +class TextDocumentChangeRegistrationOptions: + """Describe options to be used when registered for text document change events.""" + + sync_kind: TextDocumentSyncKind = attrs.field() + """How documents are synced to the server.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + +@attrs.define +class DidCloseTextDocumentParams: + """The parameters sent in a close text document notification""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document that was closed.""" + + +@attrs.define +class DidSaveTextDocumentParams: + """The parameters sent in a save text document notification""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document that was saved.""" + + text: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """Optional the content when saved. Depends on the includeText value + when the save notification was requested.""" + + +@attrs.define +class SaveOptions: + """Save options.""" + + include_text: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client is supposed to include the content on save.""" + + +@attrs.define +class TextDocumentSaveRegistrationOptions: + """Save registration options.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + include_text: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client is supposed to include the content on save.""" + + +@attrs.define +class WillSaveTextDocumentParams: + """The parameters sent in a will save text document notification.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document that will be saved.""" + + reason: TextDocumentSaveReason = attrs.field() + """The 'TextDocumentSaveReason'.""" + + +@attrs.define +class TextEdit: + """A text edit applicable to a text document.""" + + range: "Range" = attrs.field() + """The range of the text document to be manipulated. To insert + text into a document create a range where start === end.""" + + new_text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The string to be inserted. For delete operations use an + empty string.""" + + +@attrs.define +class DidChangeWatchedFilesParams: + """The watched files change notification's parameters.""" + + changes: Sequence["FileEvent"] = attrs.field() + """The actual file events.""" + + +@attrs.define +class DidChangeWatchedFilesRegistrationOptions: + """Describe options to be used when registered for text document change events.""" + + watchers: Sequence["FileSystemWatcher"] = attrs.field() + """The watchers to register.""" + + +@attrs.define +class PublishDiagnosticsParams: + """The publish diagnostic notification's parameters.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The URI for which diagnostic information is reported.""" + + diagnostics: Sequence["Diagnostic"] = attrs.field() + """An array of diagnostic information items.""" + + version: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.integer_validator), default=None + ) + """Optional the version number of the document the diagnostics are published for. + + @since 3.15.0""" + # Since: 3.15.0 + + +@attrs.define +class CompletionParams: + """Completion parameters""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + context: Optional["CompletionContext"] = attrs.field(default=None) + """The completion context. This is only available it the client specifies + to send this using the client capability `textDocument.completion.contextSupport === true`""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class CompletionItem: + """A completion item represents a text snippet that is + proposed to complete text that is being typed.""" + + label: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The label of this completion item. + + The label property is also by default the text that + is inserted when selecting this completion. + + If label details are provided the label itself should + be an unqualified name of the completion item.""" + + label_details: Optional["CompletionItemLabelDetails"] = attrs.field(default=None) + """Additional details for the label + + @since 3.17.0""" + # Since: 3.17.0 + + kind: Optional[CompletionItemKind] = attrs.field(default=None) + """The kind of this completion item. Based of the kind + an icon is chosen by the editor.""" + + tags: Optional[Sequence[CompletionItemTag]] = attrs.field(default=None) + """Tags for this completion item. + + @since 3.15.0""" + # Since: 3.15.0 + + detail: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A human-readable string with additional information + about this item, like type or symbol information.""" + + documentation: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) + """A human-readable string that represents a doc-comment.""" + + deprecated: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Indicates if this item is deprecated. + @deprecated Use `tags` instead.""" + + preselect: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Select this item when showing. + + *Note* that only one completion item can be selected and that the + tool / client decides which item that is. The rule is that the *first* + item of those that match best is selected.""" + + sort_text: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A string that should be used when comparing this item + with other items. When `falsy` the {@link CompletionItem.label label} + is used.""" + + filter_text: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A string that should be used when filtering a set of + completion items. When `falsy` the {@link CompletionItem.label label} + is used.""" + + insert_text: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A string that should be inserted into a document when selecting + this completion. When `falsy` the {@link CompletionItem.label label} + is used. + + The `insertText` is subject to interpretation by the client side. + Some tools might not take the string literally. For example + VS Code when code complete is requested in this example + `con` and a completion item with an `insertText` of + `console` is provided it will only insert `sole`. Therefore it is + recommended to use `textEdit` instead since it avoids additional client + side interpretation.""" + + insert_text_format: Optional[InsertTextFormat] = attrs.field(default=None) + """The format of the insert text. The format applies to both the + `insertText` property and the `newText` property of a provided + `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`. + + Please note that the insertTextFormat doesn't apply to + `additionalTextEdits`.""" + + insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) + """How whitespace and indentation is handled during completion + item insertion. If not provided the clients default value depends on + the `textDocument.completion.insertTextMode` client capability. + + @since 3.16.0""" + # Since: 3.16.0 + + text_edit: Optional[Union[TextEdit, "InsertReplaceEdit"]] = attrs.field( + default=None + ) + """An {@link TextEdit edit} which is applied to a document when selecting + this completion. When an edit is provided the value of + {@link CompletionItem.insertText insertText} is ignored. + + Most editors support two different operations when accepting a completion + item. One is to insert a completion text and the other is to replace an + existing text with a completion text. Since this can usually not be + predetermined by a server it can report both ranges. Clients need to + signal support for `InsertReplaceEdits` via the + `textDocument.completion.insertReplaceSupport` client capability + property. + + *Note 1:* The text edit's range as well as both ranges from an insert + replace edit must be a [single line] and they must contain the position + at which completion has been requested. + *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range + must be a prefix of the edit's replace range, that means it must be + contained and starting at the same position. + + @since 3.16.0 additional type `InsertReplaceEdit`""" + # Since: 3.16.0 additional type `InsertReplaceEdit` + + text_edit_text: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The edit text used if the completion item is part of a CompletionList and + CompletionList defines an item default for the text edit range. + + Clients will only honor this property if they opt into completion list + item defaults using the capability `completionList.itemDefaults`. + + If not provided and a list's default range is provided the label + property is used as a text. + + @since 3.17.0""" + # Since: 3.17.0 + + additional_text_edits: Optional[Sequence[TextEdit]] = attrs.field(default=None) + """An optional array of additional {@link TextEdit text edits} that are applied when + selecting this completion. Edits must not overlap (including the same insert position) + with the main {@link CompletionItem.textEdit edit} nor with themselves. + + Additional text edits should be used to change text unrelated to the current cursor position + (for example adding an import statement at the top of the file if the completion item will + insert an unqualified type).""" + + commit_characters: Optional[Sequence[str]] = attrs.field(default=None) + """An optional set of characters that when pressed while this completion is active will accept it first and + then type that character. *Note* that all commit characters should have `length=1` and that superfluous + characters will be ignored.""" + + command: Optional["Command"] = attrs.field(default=None) + """An optional {@link Command command} that is executed *after* inserting this completion. *Note* that + additional modifications to the current document should be described with the + {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved on a completion item between a + {@link CompletionRequest} and a {@link CompletionResolveRequest}.""" + + +@attrs.define +class CompletionList: + """Represents a collection of {@link CompletionItem completion items} to be presented + in the editor.""" + + is_incomplete: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """This list it not complete. Further typing results in recomputing this list. + + Recomputed lists have all their items replaced (not appended) in the + incomplete completion sessions.""" + + items: Sequence[CompletionItem] = attrs.field() + """The completion items.""" + + item_defaults: Optional["CompletionItemDefaults"] = attrs.field(default=None) + """In many cases the items of an actual completion result share the same + value for properties like `commitCharacters` or the range of a text + edit. A completion list can therefore define item defaults which will + be used if a completion item itself doesn't specify the value. + + If a completion list specifies a default value and a completion item + also specifies a corresponding value the one from the item is used. + + Servers are only allowed to return default values if the client + signals support for this via the `completionList.itemDefaults` + capability. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class CompletionOptions: + """Completion options.""" + + trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) + """Most tools trigger completion request automatically without explicitly requesting + it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user + starts to type an identifier. For example if the user types `c` in a JavaScript file + code complete will automatically pop up present `console` besides others as a + completion item. Characters that make up identifiers don't need to be listed here. + + If code complete should automatically be trigger on characters not being valid inside + an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.""" + + all_commit_characters: Optional[Sequence[str]] = attrs.field(default=None) + """The list of all possible characters that commit a completion. This field can be used + if clients don't support individual commit characters per completion item. See + `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + + If a server provides both `allCommitCharacters` and commit characters on an individual + completion item the ones on the completion item win. + + @since 3.2.0""" + # Since: 3.2.0 + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for a completion item.""" + + completion_item: Optional["ServerCompletionItemOptions"] = attrs.field(default=None) + """The server supports the following `CompletionItem` specific + capabilities. + + @since 3.17.0""" + # Since: 3.17.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class CompletionRegistrationOptions: + """Registration options for a {@link CompletionRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) + """Most tools trigger completion request automatically without explicitly requesting + it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user + starts to type an identifier. For example if the user types `c` in a JavaScript file + code complete will automatically pop up present `console` besides others as a + completion item. Characters that make up identifiers don't need to be listed here. + + If code complete should automatically be trigger on characters not being valid inside + an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.""" + + all_commit_characters: Optional[Sequence[str]] = attrs.field(default=None) + """The list of all possible characters that commit a completion. This field can be used + if clients don't support individual commit characters per completion item. See + `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + + If a server provides both `allCommitCharacters` and commit characters on an individual + completion item the ones on the completion item win. + + @since 3.2.0""" + # Since: 3.2.0 + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for a completion item.""" + + completion_item: Optional["ServerCompletionItemOptions"] = attrs.field(default=None) + """The server supports the following `CompletionItem` specific + capabilities. + + @since 3.17.0""" + # Since: 3.17.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class HoverParams: + """Parameters for a {@link HoverRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class Hover: + """The result of a hover request.""" + + contents: Union[ + "MarkupContent", MarkedString, Sequence[MarkedString] + ] = attrs.field() + """The hover's content""" + + range: Optional["Range"] = attrs.field(default=None) + """An optional range inside the text document that is used to + visualize the hover, e.g. by changing the background color.""" + + +@attrs.define +class HoverOptions: + """Hover options.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class HoverRegistrationOptions: + """Registration options for a {@link HoverRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class SignatureHelpParams: + """Parameters for a {@link SignatureHelpRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + context: Optional["SignatureHelpContext"] = attrs.field(default=None) + """The signature help context. This is only available if the client specifies + to send this using the client capability `textDocument.signatureHelp.contextSupport === true` + + @since 3.15.0""" + # Since: 3.15.0 + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class SignatureHelp: + """Signature help represents the signature of something + callable. There can be multiple signature but only one + active and only one active parameter.""" + + signatures: Sequence["SignatureInformation"] = attrs.field() + """One or more signatures.""" + + active_signature: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The active signature. If omitted or the value lies outside the + range of `signatures` the value defaults to zero or is ignored if + the `SignatureHelp` has no signatures. + + Whenever possible implementors should make an active decision about + the active signature and shouldn't rely on a default value. + + In future version of the protocol this property might become + mandatory to better express this.""" + + active_parameter: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The active parameter of the active signature. If omitted or the value + lies outside the range of `signatures[activeSignature].parameters` + defaults to 0 if the active signature has parameters. If + the active signature has no parameters it is ignored. + In future version of the protocol this property might become + mandatory to better express the active parameter if the + active signature does have any.""" + + +@attrs.define +class SignatureHelpOptions: + """Server Capabilities for a {@link SignatureHelpRequest}.""" + + trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) + """List of characters that trigger signature help automatically.""" + + retrigger_characters: Optional[Sequence[str]] = attrs.field(default=None) + """List of characters that re-trigger signature help. + + These trigger characters are only active when signature help is already showing. All trigger characters + are also counted as re-trigger characters. + + @since 3.15.0""" + # Since: 3.15.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class SignatureHelpRegistrationOptions: + """Registration options for a {@link SignatureHelpRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + trigger_characters: Optional[Sequence[str]] = attrs.field(default=None) + """List of characters that trigger signature help automatically.""" + + retrigger_characters: Optional[Sequence[str]] = attrs.field(default=None) + """List of characters that re-trigger signature help. + + These trigger characters are only active when signature help is already showing. All trigger characters + are also counted as re-trigger characters. + + @since 3.15.0""" + # Since: 3.15.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DefinitionParams: + """Parameters for a {@link DefinitionRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class DefinitionOptions: + """Server Capabilities for a {@link DefinitionRequest}.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DefinitionRegistrationOptions: + """Registration options for a {@link DefinitionRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class ReferenceParams: + """Parameters for a {@link ReferencesRequest}.""" + + context: "ReferenceContext" = attrs.field() + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class ReferenceOptions: + """Reference options.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class ReferenceRegistrationOptions: + """Registration options for a {@link ReferencesRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentHighlightParams: + """Parameters for a {@link DocumentHighlightRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class DocumentHighlight: + """A document highlight is a range inside a text document which deserves + special attention. Usually a document highlight is visualized by changing + the background color of its range.""" + + range: "Range" = attrs.field() + """The range this highlight applies to.""" + + kind: Optional[DocumentHighlightKind] = attrs.field(default=None) + """The highlight kind, default is {@link DocumentHighlightKind.Text text}.""" + + +@attrs.define +class DocumentHighlightOptions: + """Provider options for a {@link DocumentHighlightRequest}.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentHighlightRegistrationOptions: + """Registration options for a {@link DocumentHighlightRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentSymbolParams: + """Parameters for a {@link DocumentSymbolRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class BaseSymbolInformation: + """A base for all symbol information.""" + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of this symbol.""" + + kind: SymbolKind = attrs.field() + """The kind of this symbol.""" + + tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) + """Tags for this symbol. + + @since 3.16.0""" + # Since: 3.16.0 + + container_name: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The name of the symbol containing this symbol. This information is for + user interface purposes (e.g. to render a qualifier in the user interface + if necessary). It can't be used to re-infer a hierarchy for the document + symbols.""" + + +@attrs.define +class SymbolInformation: + """Represents information about programming constructs like variables, classes, + interfaces etc.""" + + location: Location = attrs.field() + """The location of this symbol. The location's range is used by a tool + to reveal the location in the editor. If the symbol is selected in the + tool the range's start information is used to position the cursor. So + the range usually spans more than the actual symbol's name and does + normally include things like visibility modifiers. + + The range doesn't have to denote a node range in the sense of an abstract + syntax tree. It can therefore not be used to re-construct a hierarchy of + the symbols.""" + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of this symbol.""" + + kind: SymbolKind = attrs.field() + """The kind of this symbol.""" + + deprecated: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Indicates if this symbol is deprecated. + + @deprecated Use tags instead""" + + tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) + """Tags for this symbol. + + @since 3.16.0""" + # Since: 3.16.0 + + container_name: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The name of the symbol containing this symbol. This information is for + user interface purposes (e.g. to render a qualifier in the user interface + if necessary). It can't be used to re-infer a hierarchy for the document + symbols.""" + + +@attrs.define +class DocumentSymbol: + """Represents programming constructs like variables, classes, interfaces etc. + that appear in a document. Document symbols can be hierarchical and they + have two ranges: one that encloses its definition and one that points to + its most interesting range, e.g. the range of an identifier.""" + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of this symbol. Will be displayed in the user interface and therefore must not be + an empty string or a string only consisting of white spaces.""" + + kind: SymbolKind = attrs.field() + """The kind of this symbol.""" + + range: "Range" = attrs.field() + """The range enclosing this symbol not including leading/trailing whitespace but everything else + like comments. This information is typically used to determine if the clients cursor is + inside the symbol to reveal in the symbol in the UI.""" + + selection_range: "Range" = attrs.field() + """The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. + Must be contained by the `range`.""" + + detail: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) + """Tags for this document symbol. + + @since 3.16.0""" + # Since: 3.16.0 + + deprecated: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Indicates if this symbol is deprecated. + + @deprecated Use tags instead""" + + children: Optional[Sequence["DocumentSymbol"]] = attrs.field(default=None) + """Children of this symbol, e.g. properties of a class.""" + + +@attrs.define +class DocumentSymbolOptions: + """Provider options for a {@link DocumentSymbolRequest}.""" + + label: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A human-readable string that is shown when multiple outlines trees + are shown for the same document. + + @since 3.16.0""" + # Since: 3.16.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentSymbolRegistrationOptions: + """Registration options for a {@link DocumentSymbolRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + label: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A human-readable string that is shown when multiple outlines trees + are shown for the same document. + + @since 3.16.0""" + # Since: 3.16.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class CodeActionParams: + """The parameters of a {@link CodeActionRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document in which the command was invoked.""" + + range: "Range" = attrs.field() + """The range for which the command was invoked.""" + + context: "CodeActionContext" = attrs.field() + """Context carrying additional information.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class Command: + """Represents a reference to a command. Provides a title which + will be used to represent a command in the UI and, optionally, + an array of arguments which will be passed to the command handler + function when invoked.""" + + title: str = attrs.field(validator=attrs.validators.instance_of(str)) + """Title of the command, like `save`.""" + + command: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The identifier of the actual command handler.""" + + arguments: Optional[Sequence[LSPAny]] = attrs.field(default=None) + """Arguments that the command handler should be + invoked with.""" + + +@attrs.define +class CodeAction: + """A code action represents a change that can be performed in code, e.g. to fix a problem or + to refactor code. + + A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed. + """ + + title: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A short, human-readable, title for this code action.""" + + kind: Optional[Union[CodeActionKind, str]] = attrs.field(default=None) + """The kind of the code action. + + Used to filter code actions.""" + + diagnostics: Optional[Sequence["Diagnostic"]] = attrs.field(default=None) + """The diagnostics that this code action resolves.""" + + is_preferred: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted + by keybindings. + + A quick fix should be marked preferred if it properly addresses the underlying error. + A refactoring should be marked preferred if it is the most reasonable choice of actions to take. + + @since 3.15.0""" + # Since: 3.15.0 + + disabled: Optional["CodeActionDisabled"] = attrs.field(default=None) + """Marks that the code action cannot currently be applied. + + Clients should follow the following guidelines regarding disabled code actions: + + - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) + code action menus. + + - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type + of code action, such as refactorings. + + - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) + that auto applies a code action and only disabled code actions are returned, the client should show the user an + error message with `reason` in the editor. + + @since 3.16.0""" + # Since: 3.16.0 + + edit: Optional[WorkspaceEdit] = attrs.field(default=None) + """The workspace edit this code action performs.""" + + command: Optional[Command] = attrs.field(default=None) + """A command this code action executes. If a code action + provides an edit and a command, first the edit is + executed and then the command.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved on a code action between + a `textDocument/codeAction` and a `codeAction/resolve` request. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class CodeActionOptions: + """Provider options for a {@link CodeActionRequest}.""" + + code_action_kinds: Optional[Sequence[Union[CodeActionKind, str]]] = attrs.field( + default=None + ) + """CodeActionKinds that this server may return. + + The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + may list out every specific kind they provide.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for a code action. + + @since 3.16.0""" + # Since: 3.16.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class CodeActionRegistrationOptions: + """Registration options for a {@link CodeActionRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + code_action_kinds: Optional[Sequence[Union[CodeActionKind, str]]] = attrs.field( + default=None + ) + """CodeActionKinds that this server may return. + + The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + may list out every specific kind they provide.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for a code action. + + @since 3.16.0""" + # Since: 3.16.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class WorkspaceSymbolParams: + """The parameters of a {@link WorkspaceSymbolRequest}.""" + + query: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A query string to filter symbols by. Clients may send an empty + string here to request all symbols.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class WorkspaceSymbol: + """A special workspace symbol that supports locations without a range. + + See also SymbolInformation. + + @since 3.17.0""" + + # Since: 3.17.0 + + location: Union[Location, "LocationUriOnly"] = attrs.field() + """The location of the symbol. Whether a server is allowed to + return a location without a range depends on the client + capability `workspace.symbol.resolveSupport`. + + See SymbolInformation#location for more details.""" + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of this symbol.""" + + kind: SymbolKind = attrs.field() + """The kind of this symbol.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved on a workspace symbol between a + workspace symbol request and a workspace symbol resolve request.""" + + tags: Optional[Sequence[SymbolTag]] = attrs.field(default=None) + """Tags for this symbol. + + @since 3.16.0""" + # Since: 3.16.0 + + container_name: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The name of the symbol containing this symbol. This information is for + user interface purposes (e.g. to render a qualifier in the user interface + if necessary). It can't be used to re-infer a hierarchy for the document + symbols.""" + + +@attrs.define +class WorkspaceSymbolOptions: + """Server capabilities for a {@link WorkspaceSymbolRequest}.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for a workspace symbol. + + @since 3.17.0""" + # Since: 3.17.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class WorkspaceSymbolRegistrationOptions: + """Registration options for a {@link WorkspaceSymbolRequest}.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server provides support to resolve additional + information for a workspace symbol. + + @since 3.17.0""" + # Since: 3.17.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class CodeLensParams: + """The parameters of a {@link CodeLensRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document to request code lens for.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class CodeLens: + """A code lens represents a {@link Command command} that should be shown along with + source text, like the number of references, a way to run tests, etc. + + A code lens is _unresolved_ when no command is associated to it. For performance + reasons the creation of a code lens and resolving should be done in two stages.""" + + range: "Range" = attrs.field() + """The range in which this code lens is valid. Should only span a single line.""" + + command: Optional[Command] = attrs.field(default=None) + """The command this code lens represents.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved on a code lens item between + a {@link CodeLensRequest} and a {@link CodeLensResolveRequest}""" + + +@attrs.define +class CodeLensOptions: + """Code Lens provider options of a {@link CodeLensRequest}.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Code lens has a resolve provider as well.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class CodeLensRegistrationOptions: + """Registration options for a {@link CodeLensRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Code lens has a resolve provider as well.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentLinkParams: + """The parameters of a {@link DocumentLinkRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document to provide document links for.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + partial_result_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report partial results (e.g. streaming) to + the client.""" + + +@attrs.define +class DocumentLink: + """A document link is a range in a text document that links to an internal or external resource, like another + text document or a web site.""" + + range: "Range" = attrs.field() + """The range this link applies to.""" + + target: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The uri this link points to. If missing a resolve request is sent later.""" + + tooltip: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The tooltip text when you hover over this link. + + If a tooltip is provided, is will be displayed in a string that includes instructions on how to + trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS, + user settings, and localization. + + @since 3.15.0""" + # Since: 3.15.0 + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved on a document link between a + DocumentLinkRequest and a DocumentLinkResolveRequest.""" + + +@attrs.define +class DocumentLinkOptions: + """Provider options for a {@link DocumentLinkRequest}.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Document links have a resolve provider as well.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentLinkRegistrationOptions: + """Registration options for a {@link DocumentLinkRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + resolve_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Document links have a resolve provider as well.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentFormattingParams: + """The parameters of a {@link DocumentFormattingRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document to format.""" + + options: "FormattingOptions" = attrs.field() + """The format options.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class DocumentFormattingOptions: + """Provider options for a {@link DocumentFormattingRequest}.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentFormattingRegistrationOptions: + """Registration options for a {@link DocumentFormattingRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentRangeFormattingParams: + """The parameters of a {@link DocumentRangeFormattingRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document to format.""" + + range: "Range" = attrs.field() + """The range to format""" + + options: "FormattingOptions" = attrs.field() + """The format options""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class DocumentRangeFormattingOptions: + """Provider options for a {@link DocumentRangeFormattingRequest}.""" + + ranges_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the server supports formatting multiple ranges at once. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentRangeFormattingRegistrationOptions: + """Registration options for a {@link DocumentRangeFormattingRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + ranges_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the server supports formatting multiple ranges at once. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class DocumentRangesFormattingParams: + """The parameters of a {@link DocumentRangesFormattingRequest}. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document to format.""" + + ranges: Sequence["Range"] = attrs.field() + """The ranges to format""" + + options: "FormattingOptions" = attrs.field() + """The format options""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class DocumentOnTypeFormattingParams: + """The parameters of a {@link DocumentOnTypeFormattingRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document to format.""" + + position: "Position" = attrs.field() + """The position around which the on type formatting should happen. + This is not necessarily the exact position where the character denoted + by the property `ch` got typed.""" + + ch: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The character that has been typed that triggered the formatting + on type request. That is not necessarily the last character that + got inserted into the document since the client could auto insert + characters as well (e.g. like automatic brace completion).""" + + options: "FormattingOptions" = attrs.field() + """The formatting options.""" + + +@attrs.define +class DocumentOnTypeFormattingOptions: + """Provider options for a {@link DocumentOnTypeFormattingRequest}.""" + + first_trigger_character: str = attrs.field( + validator=attrs.validators.instance_of(str) + ) + """A character on which formatting should be triggered, like `{`.""" + + more_trigger_character: Optional[Sequence[str]] = attrs.field(default=None) + """More trigger characters.""" + + +@attrs.define +class DocumentOnTypeFormattingRegistrationOptions: + """Registration options for a {@link DocumentOnTypeFormattingRequest}.""" + + first_trigger_character: str = attrs.field( + validator=attrs.validators.instance_of(str) + ) + """A character on which formatting should be triggered, like `{`.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + more_trigger_character: Optional[Sequence[str]] = attrs.field(default=None) + """More trigger characters.""" + + +@attrs.define +class RenameParams: + """The parameters of a {@link RenameRequest}.""" + + text_document: "TextDocumentIdentifier" = attrs.field() + """The document to rename.""" + + position: "Position" = attrs.field() + """The position at which this request was sent.""" + + new_name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The new name of the symbol. If the given name is not valid the + request must return a {@link ResponseError} with an + appropriate message set.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class RenameOptions: + """Provider options for a {@link RenameRequest}.""" + + prepare_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Renames should be checked and tested before being executed. + + @since version 3.12.0""" + # Since: version 3.12.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class RenameRegistrationOptions: + """Registration options for a {@link RenameRequest}.""" + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + prepare_provider: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Renames should be checked and tested before being executed. + + @since version 3.12.0""" + # Since: version 3.12.0 + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class PrepareRenameParams: + text_document: "TextDocumentIdentifier" = attrs.field() + """The text document.""" + + position: "Position" = attrs.field() + """The position inside the text document.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class ExecuteCommandParams: + """The parameters of a {@link ExecuteCommandRequest}.""" + + command: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The identifier of the actual command handler.""" + + arguments: Optional[Sequence[LSPAny]] = attrs.field(default=None) + """Arguments that the command should be invoked with.""" + + work_done_token: Optional[ProgressToken] = attrs.field(default=None) + """An optional token that a server can use to report work done progress.""" + + +@attrs.define +class ExecuteCommandOptions: + """The server capabilities of a {@link ExecuteCommandRequest}.""" + + commands: Sequence[str] = attrs.field() + """The commands to be executed on the server""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class ExecuteCommandRegistrationOptions: + """Registration options for a {@link ExecuteCommandRequest}.""" + + commands: Sequence[str] = attrs.field() + """The commands to be executed on the server""" + + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + +@attrs.define +class ApplyWorkspaceEditParams: + """The parameters passed via an apply workspace edit request.""" + + edit: WorkspaceEdit = attrs.field() + """The edits to apply.""" + + label: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional label of the workspace edit. This label is + presented in the user interface for example on an undo + stack to undo the workspace edit.""" + + +@attrs.define +class ApplyWorkspaceEditResult: + """The result returned from the apply workspace edit request. + + @since 3.17 renamed from ApplyWorkspaceEditResponse""" + + # Since: 3.17 renamed from ApplyWorkspaceEditResponse + + applied: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """Indicates whether the edit was applied or not.""" + + failure_reason: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional textual description for why the edit was not applied. + This may be used by the server for diagnostic logging or to provide + a suitable error for a request that triggered the edit.""" + + failed_change: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """Depending on the client's failure handling strategy `failedChange` might + contain the index of the change that failed. This property is only available + if the client signals a `failureHandlingStrategy` in its client capabilities.""" + + +@attrs.define +class WorkDoneProgressBegin: + title: str = attrs.field(validator=attrs.validators.instance_of(str)) + """Mandatory title of the progress operation. Used to briefly inform about + the kind of operation being performed. + + Examples: "Indexing" or "Linking dependencies".""" + + kind: str = attrs.field(validator=attrs.validators.in_(["begin"]), default="begin") + + cancellable: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Controls if a cancel button should show to allow the user to cancel the + long running operation. Clients that don't support cancellation are allowed + to ignore the setting.""" + + message: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """Optional, more detailed associated progress message. Contains + complementary information to the `title`. + + Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". + If unset, the previous progress message (if any) is still valid.""" + + percentage: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """Optional progress percentage to display (value 100 is considered 100%). + If not provided infinite progress is assumed and clients are allowed + to ignore the `percentage` value in subsequent in report notifications. + + The value should be steadily rising. Clients are free to ignore values + that are not following this rule. The value range is [0, 100].""" + + +@attrs.define +class WorkDoneProgressReport: + kind: str = attrs.field( + validator=attrs.validators.in_(["report"]), default="report" + ) + + cancellable: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Controls enablement state of a cancel button. + + Clients that don't support cancellation or don't support controlling the button's + enablement state are allowed to ignore the property.""" + + message: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """Optional, more detailed associated progress message. Contains + complementary information to the `title`. + + Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". + If unset, the previous progress message (if any) is still valid.""" + + percentage: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """Optional progress percentage to display (value 100 is considered 100%). + If not provided infinite progress is assumed and clients are allowed + to ignore the `percentage` value in subsequent in report notifications. + + The value should be steadily rising. Clients are free to ignore values + that are not following this rule. The value range is [0, 100]""" + + +@attrs.define +class WorkDoneProgressEnd: + kind: str = attrs.field(validator=attrs.validators.in_(["end"]), default="end") + + message: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """Optional, a final message indicating to for example indicate the outcome + of the operation.""" + + +@attrs.define +class SetTraceParams: + value: TraceValues = attrs.field() + + +@attrs.define +class LogTraceParams: + message: str = attrs.field(validator=attrs.validators.instance_of(str)) + + verbose: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + + +@attrs.define +class CancelParams: + id: Union[int, str] = attrs.field() + """The request id to cancel.""" + + +@attrs.define +class ProgressParams: + token: ProgressToken = attrs.field() + """The progress token provided by the client or server.""" + + value: LSPAny = attrs.field() + """The progress data.""" + + +@attrs.define +class LocationLink: + """Represents the connection of two locations. Provides additional metadata over normal {@link Location locations}, + including an origin range.""" + + target_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The target resource identifier of this link.""" + + target_range: "Range" = attrs.field() + """The full target range of this link. If the target for example is a symbol then target range is the + range enclosing this symbol not including leading/trailing whitespace but everything else + like comments. This information is typically used to highlight the range in the editor.""" + + target_selection_range: "Range" = attrs.field() + """The range that should be selected and revealed when this link is being followed, e.g the name of a function. + Must be contained by the `targetRange`. See also `DocumentSymbol#range`""" + + origin_selection_range: Optional["Range"] = attrs.field(default=None) + """Span of the origin of this link. + + Used as the underlined span for mouse interaction. Defaults to the word range at + the definition position.""" + + +@attrs.define +class Range: + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. + For example: + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ```""" + + start: "Position" = attrs.field() + """The range's start position.""" + + end: "Position" = attrs.field() + """The range's end position.""" + + def __eq__(self, o: object) -> bool: + if not isinstance(o, Range): + return NotImplemented + return (self.start == o.start) and (self.end == o.end) + + def __repr__(self) -> str: + return f"{self.start!r}-{self.end!r}" + + +@attrs.define +class WorkspaceFoldersChangeEvent: + """The workspace folder change event.""" + + added: Sequence[WorkspaceFolder] = attrs.field() + """The array of added workspace folders""" + + removed: Sequence[WorkspaceFolder] = attrs.field() + """The array of the removed workspace folders""" + + +@attrs.define +class ConfigurationItem: + scope_uri: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The scope to get the configuration section for.""" + + section: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The configuration section asked for.""" + + +@attrs.define +class TextDocumentIdentifier: + """A literal to identify a text document in the client.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The text document's uri.""" + + +@attrs.define +class Color: + """Represents a color in RGBA space.""" + + red: float = attrs.field(validator=attrs.validators.instance_of(float)) + """The red component of this color in the range [0-1].""" + + green: float = attrs.field(validator=attrs.validators.instance_of(float)) + """The green component of this color in the range [0-1].""" + + blue: float = attrs.field(validator=attrs.validators.instance_of(float)) + """The blue component of this color in the range [0-1].""" + + alpha: float = attrs.field(validator=attrs.validators.instance_of(float)) + """The alpha component of this color in the range [0-1].""" + + +@attrs.define +@functools.total_ordering +class Position: + """Position in a text document expressed as zero-based line and character + offset. Prior to 3.17 the offsets were always based on a UTF-16 string + representation. So a string of the form `a𐐀b` the character offset of the + character `a` is 0, the character offset of `𐐀` is 1 and the character + offset of b is 3 since `𐐀` is represented using two code units in UTF-16. + Since 3.17 clients and servers can agree on a different string encoding + representation (e.g. UTF-8). The client announces it's supported encoding + via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities). + The value is an array of position encodings the client supports, with + decreasing preference (e.g. the encoding at index `0` is the most preferred + one). To stay backwards compatible the only mandatory encoding is UTF-16 + represented via the string `utf-16`. The server can pick one of the + encodings offered by the client and signals that encoding back to the + client via the initialize result's property + [`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value + `utf-16` is missing from the client's capability `general.positionEncodings` + servers can safely assume that the client supports UTF-16. If the server + omits the position encoding in its initialize result the encoding defaults + to the string value `utf-16`. Implementation considerations: since the + conversion from one encoding into another requires the content of the + file / line the conversion is best done where the file is read which is + usually on the server side. + + Positions are line end character agnostic. So you can not specify a position + that denotes `\r|\n` or `\n|` where `|` represents the character offset. + + @since 3.17.0 - support for negotiated position encoding.""" + + # Since: 3.17.0 - support for negotiated position encoding. + + line: int = attrs.field(validator=validators.uinteger_validator) + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. + If a line number is negative, it defaults to 0.""" + + character: int = attrs.field(validator=validators.uinteger_validator) + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length.""" + + def __eq__(self, o: object) -> bool: + if not isinstance(o, Position): + return NotImplemented + return (self.line, self.character) == (o.line, o.character) + + def __gt__(self, o: "Position") -> bool: + if not isinstance(o, Position): + return NotImplemented + return (self.line, self.character) > (o.line, o.character) + + def __repr__(self) -> str: + return f"{self.line}:{self.character}" + + +@attrs.define +class SemanticTokensEdit: + """@since 3.16.0""" + + # Since: 3.16.0 + + start: int = attrs.field(validator=validators.uinteger_validator) + """The start offset of the edit.""" + + delete_count: int = attrs.field(validator=validators.uinteger_validator) + """The count of elements to remove.""" + + data: Optional[Sequence[int]] = attrs.field(default=None) + """The elements to insert.""" + + +@attrs.define +class FileCreate: + """Represents information on a file/folder create. + + @since 3.16.0""" + + # Since: 3.16.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A file:// URI for the location of the file/folder being created.""" + + +@attrs.define +class TextDocumentEdit: + """Describes textual changes on a text document. A TextDocumentEdit describes all changes + on a document version Si and after they are applied move the document to version Si+1. + So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any + kind of ordering. However the edits must be non overlapping.""" + + text_document: "OptionalVersionedTextDocumentIdentifier" = attrs.field() + """The text document to change.""" + + edits: Sequence[Union[TextEdit, "AnnotatedTextEdit"]] = attrs.field() + """The edits to be applied. + + @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a + client capability.""" + # Since: 3.16.0 - support for AnnotatedTextEdit. This is guarded using aclient capability. + + +@attrs.define +class ResourceOperation: + """A generic resource operation.""" + + kind: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The resource operation kind.""" + + annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) + """An optional annotation identifier describing the operation. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class CreateFile: + """Create file operation.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The resource to create.""" + + kind: str = attrs.field( + validator=attrs.validators.in_(["create"]), default="create" + ) + """A create""" + + options: Optional["CreateFileOptions"] = attrs.field(default=None) + """Additional options""" + + annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) + """An optional annotation identifier describing the operation. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class RenameFile: + """Rename file operation""" + + old_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The old (existing) location.""" + + new_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The new location.""" + + kind: str = attrs.field( + validator=attrs.validators.in_(["rename"]), default="rename" + ) + """A rename""" + + options: Optional["RenameFileOptions"] = attrs.field(default=None) + """Rename options.""" + + annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) + """An optional annotation identifier describing the operation. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class DeleteFile: + """Delete file operation""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The file to delete.""" + + kind: str = attrs.field( + validator=attrs.validators.in_(["delete"]), default="delete" + ) + """A delete""" + + options: Optional["DeleteFileOptions"] = attrs.field(default=None) + """Delete options.""" + + annotation_id: Optional[ChangeAnnotationIdentifier] = attrs.field(default=None) + """An optional annotation identifier describing the operation. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class ChangeAnnotation: + """Additional information that describes document changes. + + @since 3.16.0""" + + # Since: 3.16.0 + + label: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A human-readable string describing the actual change. The string + is rendered prominent in the user interface.""" + + needs_confirmation: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """A flag which indicates that user confirmation is needed + before applying the change.""" + + description: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A human-readable string which is rendered less prominent in + the user interface.""" + + +@attrs.define +class FileOperationFilter: + """A filter to describe in which file operation requests or notifications + the server is interested in receiving. + + @since 3.16.0""" + + # Since: 3.16.0 + + pattern: "FileOperationPattern" = attrs.field() + """The actual file operation pattern.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri scheme like `file` or `untitled`.""" + + +@attrs.define +class FileRename: + """Represents information on a file/folder rename. + + @since 3.16.0""" + + # Since: 3.16.0 + + old_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A file:// URI for the original location of the file/folder being renamed.""" + + new_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A file:// URI for the new location of the file/folder being renamed.""" + + +@attrs.define +class FileDelete: + """Represents information on a file/folder delete. + + @since 3.16.0""" + + # Since: 3.16.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A file:// URI for the location of the file/folder being deleted.""" + + +@attrs.define +class InlineValueContext: + """@since 3.17.0""" + + # Since: 3.17.0 + + frame_id: int = attrs.field(validator=validators.integer_validator) + """The stack frame (as a DAP Id) where the execution has stopped.""" + + stopped_location: Range = attrs.field() + """The document range where execution has stopped. + Typically the end position of the range denotes the line where the inline values are shown.""" + + +@attrs.define +class InlineValueText: + """Provide inline value as text. + + @since 3.17.0""" + + # Since: 3.17.0 + + range: Range = attrs.field() + """The document range for which the inline value applies.""" + + text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The text of the inline value.""" + + +@attrs.define +class InlineValueVariableLookup: + """Provide inline value through a variable lookup. + If only a range is specified, the variable name will be extracted from the underlying document. + An optional variable name can be used to override the extracted name. + + @since 3.17.0""" + + # Since: 3.17.0 + + range: Range = attrs.field() + """The document range for which the inline value applies. + The range is used to extract the variable name from the underlying document.""" + + case_sensitive_lookup: bool = attrs.field( + validator=attrs.validators.instance_of(bool) + ) + """How to perform the lookup.""" + + variable_name: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """If specified the name of the variable to look up.""" + + +@attrs.define +class InlineValueEvaluatableExpression: + """Provide an inline value through an expression evaluation. + If only a range is specified, the expression will be extracted from the underlying document. + An optional expression can be used to override the extracted expression. + + @since 3.17.0""" + + # Since: 3.17.0 + + range: Range = attrs.field() + """The document range for which the inline value applies. + The range is used to extract the evaluatable expression from the underlying document.""" + + expression: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """If specified the expression overrides the extracted expression.""" + + +@attrs.define +class InlayHintLabelPart: + """An inlay hint label part allows for interactive and composite labels + of inlay hints. + + @since 3.17.0""" + + # Since: 3.17.0 + + value: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The value of this label part.""" + + tooltip: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) + """The tooltip text when you hover over this label part. Depending on + the client capability `inlayHint.resolveSupport` clients might resolve + this property late using the resolve request.""" + + location: Optional[Location] = attrs.field(default=None) + """An optional source code location that represents this + label part. + + The editor will use this location for the hover and for code navigation + features: This part will become a clickable link that resolves to the + definition of the symbol at the given location (not necessarily the + location itself), it shows the hover that shows at the given location, + and it shows a context menu with further code navigation commands. + + Depending on the client capability `inlayHint.resolveSupport` clients + might resolve this property late using the resolve request.""" + + command: Optional[Command] = attrs.field(default=None) + """An optional command for this label part. + + Depending on the client capability `inlayHint.resolveSupport` clients + might resolve this property late using the resolve request.""" + + +@attrs.define +class MarkupContent: + """A `MarkupContent` literal represents a string value which content is interpreted base on its + kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds. + + If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues. + See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting + + Here is an example how such a string can be constructed using JavaScript / TypeScript: + ```ts + let markdown: MarkdownContent = { + kind: MarkupKind.Markdown, + value: [ + '# Header', + 'Some text', + '```typescript', + 'someCode();', + '```' + ].join('\n') + }; + ``` + + *Please Note* that clients might sanitize the return markdown. A client could decide to + remove HTML from the markdown to avoid script execution.""" + + kind: MarkupKind = attrs.field() + """The type of the Markup""" + + value: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The content itself""" + + +@attrs.define +class FullDocumentDiagnosticReport: + """A diagnostic report with a full set of problems. + + @since 3.17.0""" + + # Since: 3.17.0 + + items: Sequence["Diagnostic"] = attrs.field() + """The actual items.""" + + kind: str = attrs.field(validator=attrs.validators.in_(["full"]), default="full") + """A full document diagnostic report.""" + + result_id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional result id. If provided it will + be sent on the next diagnostic request for the + same document.""" + + +@attrs.define +class RelatedFullDocumentDiagnosticReport: + """A full diagnostic report with a set of related documents. + + @since 3.17.0""" + + # Since: 3.17.0 + + items: Sequence["Diagnostic"] = attrs.field() + """The actual items.""" + + related_documents: Optional[ + Dict[ + str, + Union[FullDocumentDiagnosticReport, "UnchangedDocumentDiagnosticReport"], + ] + ] = attrs.field(default=None) + """Diagnostics of related documents. This information is useful + in programming languages where code in a file A can generate + diagnostics in a file B which A depends on. An example of + such a language is C/C++ where marco definitions in a file + a.cpp and result in errors in a header file b.hpp. + + @since 3.17.0""" + # Since: 3.17.0 + + kind: str = attrs.field(validator=attrs.validators.in_(["full"]), default="full") + """A full document diagnostic report.""" + + result_id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional result id. If provided it will + be sent on the next diagnostic request for the + same document.""" + + +@attrs.define +class UnchangedDocumentDiagnosticReport: + """A diagnostic report indicating that the last returned + report is still accurate. + + @since 3.17.0""" + + # Since: 3.17.0 + + result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A result id which will be sent on the next + diagnostic request for the same document.""" + + kind: str = attrs.field( + validator=attrs.validators.in_(["unchanged"]), default="unchanged" + ) + """A document diagnostic report indicating + no changes to the last result. A server can + only return `unchanged` if result ids are + provided.""" + + +@attrs.define +class RelatedUnchangedDocumentDiagnosticReport: + """An unchanged diagnostic report with a set of related documents. + + @since 3.17.0""" + + # Since: 3.17.0 + + result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A result id which will be sent on the next + diagnostic request for the same document.""" + + related_documents: Optional[ + Dict[ + str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport] + ] + ] = attrs.field(default=None) + """Diagnostics of related documents. This information is useful + in programming languages where code in a file A can generate + diagnostics in a file B which A depends on. An example of + such a language is C/C++ where marco definitions in a file + a.cpp and result in errors in a header file b.hpp. + + @since 3.17.0""" + # Since: 3.17.0 + + kind: str = attrs.field( + validator=attrs.validators.in_(["unchanged"]), default="unchanged" + ) + """A document diagnostic report indicating + no changes to the last result. A server can + only return `unchanged` if result ids are + provided.""" + + +@attrs.define +class PreviousResultId: + """A previous result id in a workspace pull request. + + @since 3.17.0""" + + # Since: 3.17.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The URI for which the client knowns a + result id.""" + + value: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The value of the previous result id.""" + + +@attrs.define +class NotebookDocument: + """A notebook document. + + @since 3.17.0""" + + # Since: 3.17.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The notebook document's uri.""" + + notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The type of the notebook.""" + + version: int = attrs.field(validator=validators.integer_validator) + """The version number of this document (it will increase after each + change, including undo/redo).""" + + cells: Sequence["NotebookCell"] = attrs.field() + """The cells of a notebook.""" + + metadata: Optional[LSPObject] = attrs.field(default=None) + """Additional metadata stored with the notebook + document. + + Note: should always be an object literal (e.g. LSPObject)""" + + +@attrs.define +class TextDocumentItem: + """An item to transfer a text document from the client to the + server.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The text document's uri.""" + + language_id: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The text document's language identifier.""" + + version: int = attrs.field(validator=validators.integer_validator) + """The version number of this document (it will increase after each + change, including undo/redo).""" + + text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The content of the opened text document.""" + + +@attrs.define +class VersionedNotebookDocumentIdentifier: + """A versioned notebook document identifier. + + @since 3.17.0""" + + # Since: 3.17.0 + + version: int = attrs.field(validator=validators.integer_validator) + """The version number of this notebook document.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The notebook document's uri.""" + + +@attrs.define +class NotebookDocumentChangeEvent: + """A change event for a notebook document. + + @since 3.17.0""" + + # Since: 3.17.0 + + metadata: Optional[LSPObject] = attrs.field(default=None) + """The changed meta data if any. + + Note: should always be an object literal (e.g. LSPObject)""" + + cells: Optional["NotebookDocumentCellChanges"] = attrs.field(default=None) + """Changes to cells""" + + +@attrs.define +class NotebookDocumentIdentifier: + """A literal to identify a notebook document in the client. + + @since 3.17.0""" + + # Since: 3.17.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The notebook document's uri.""" + + +@attrs.define +class InlineCompletionContext: + """Provides information about the context in which an inline completion was requested. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + trigger_kind: InlineCompletionTriggerKind = attrs.field() + """Describes how the inline completion was triggered.""" + + selected_completion_info: Optional["SelectedCompletionInfo"] = attrs.field( + default=None + ) + """Provides information about the currently selected item in the autocomplete widget if it is visible.""" + + +@attrs.define +class StringValue: + """A string value used as a snippet is a template which allows to insert text + and to control the editor cursor when insertion happens. + + A snippet can define tab stops and placeholders with `$1`, `$2` + and `${3:foo}`. `$0` defines the final tab stop, it defaults to + the end of the snippet. Variables are defined with `$name` and + `${name:default value}`. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The snippet string.""" + + kind: str = attrs.field( + validator=attrs.validators.in_(["snippet"]), default="snippet" + ) + """The kind of string value.""" + + +@attrs.define +class Registration: + """General parameters to register for a notification or to register a provider.""" + + id: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The id used to register the request. The id can be used to deregister + the request again.""" + + method: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The method / capability to register for.""" + + register_options: Optional[LSPAny] = attrs.field(default=None) + """Options necessary for the registration.""" + + +@attrs.define +class Unregistration: + """General parameters to unregister a request or notification.""" + + id: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The id used to unregister the request or notification. Usually an id + provided during the register request.""" + + method: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The method to unregister for.""" + + +@attrs.define +class ServerCapabilities: + """Defines the capabilities provided by a language + server.""" + + position_encoding: Optional[Union[PositionEncodingKind, str]] = attrs.field( + default=None + ) + """The position encoding the server picked from the encodings offered + by the client via the client capability `general.positionEncodings`. + + If the client didn't provide any position encodings the only valid + value that a server can return is 'utf-16'. + + If omitted it defaults to 'utf-16'. + + @since 3.17.0""" + # Since: 3.17.0 + + text_document_sync: Optional[ + Union["TextDocumentSyncOptions", TextDocumentSyncKind] + ] = attrs.field(default=None) + """Defines how text documents are synced. Is either a detailed structure + defining each notification or for backwards compatibility the + TextDocumentSyncKind number.""" + + notebook_document_sync: Optional[ + Union["NotebookDocumentSyncOptions", "NotebookDocumentSyncRegistrationOptions"] + ] = attrs.field(default=None) + """Defines how notebook documents are synced. + + @since 3.17.0""" + # Since: 3.17.0 + + completion_provider: Optional[CompletionOptions] = attrs.field(default=None) + """The server provides completion support.""" + + hover_provider: Optional[Union[bool, HoverOptions]] = attrs.field(default=None) + """The server provides hover support.""" + + signature_help_provider: Optional[SignatureHelpOptions] = attrs.field(default=None) + """The server provides signature help support.""" + + declaration_provider: Optional[ + Union[bool, DeclarationOptions, DeclarationRegistrationOptions] + ] = attrs.field(default=None) + """The server provides Goto Declaration support.""" + + definition_provider: Optional[Union[bool, DefinitionOptions]] = attrs.field( + default=None + ) + """The server provides goto definition support.""" + + type_definition_provider: Optional[ + Union[bool, TypeDefinitionOptions, TypeDefinitionRegistrationOptions] + ] = attrs.field(default=None) + """The server provides Goto Type Definition support.""" + + implementation_provider: Optional[ + Union[bool, ImplementationOptions, ImplementationRegistrationOptions] + ] = attrs.field(default=None) + """The server provides Goto Implementation support.""" + + references_provider: Optional[Union[bool, ReferenceOptions]] = attrs.field( + default=None + ) + """The server provides find references support.""" + + document_highlight_provider: Optional[ + Union[bool, DocumentHighlightOptions] + ] = attrs.field(default=None) + """The server provides document highlight support.""" + + document_symbol_provider: Optional[ + Union[bool, DocumentSymbolOptions] + ] = attrs.field(default=None) + """The server provides document symbol support.""" + + code_action_provider: Optional[Union[bool, CodeActionOptions]] = attrs.field( + default=None + ) + """The server provides code actions. CodeActionOptions may only be + specified if the client states that it supports + `codeActionLiteralSupport` in its initial `initialize` request.""" + + code_lens_provider: Optional[CodeLensOptions] = attrs.field(default=None) + """The server provides code lens.""" + + document_link_provider: Optional[DocumentLinkOptions] = attrs.field(default=None) + """The server provides document link support.""" + + color_provider: Optional[ + Union[bool, DocumentColorOptions, DocumentColorRegistrationOptions] + ] = attrs.field(default=None) + """The server provides color provider support.""" + + workspace_symbol_provider: Optional[ + Union[bool, WorkspaceSymbolOptions] + ] = attrs.field(default=None) + """The server provides workspace symbol support.""" + + document_formatting_provider: Optional[ + Union[bool, DocumentFormattingOptions] + ] = attrs.field(default=None) + """The server provides document formatting.""" + + document_range_formatting_provider: Optional[ + Union[bool, DocumentRangeFormattingOptions] + ] = attrs.field(default=None) + """The server provides document range formatting.""" + + document_on_type_formatting_provider: Optional[ + DocumentOnTypeFormattingOptions + ] = attrs.field(default=None) + """The server provides document formatting on typing.""" + + rename_provider: Optional[Union[bool, RenameOptions]] = attrs.field(default=None) + """The server provides rename support. RenameOptions may only be + specified if the client states that it supports + `prepareSupport` in its initial `initialize` request.""" + + folding_range_provider: Optional[ + Union[bool, FoldingRangeOptions, FoldingRangeRegistrationOptions] + ] = attrs.field(default=None) + """The server provides folding provider support.""" + + selection_range_provider: Optional[ + Union[bool, SelectionRangeOptions, SelectionRangeRegistrationOptions] + ] = attrs.field(default=None) + """The server provides selection range support.""" + + execute_command_provider: Optional[ExecuteCommandOptions] = attrs.field( + default=None + ) + """The server provides execute command support.""" + + call_hierarchy_provider: Optional[ + Union[bool, CallHierarchyOptions, CallHierarchyRegistrationOptions] + ] = attrs.field(default=None) + """The server provides call hierarchy support. + + @since 3.16.0""" + # Since: 3.16.0 + + linked_editing_range_provider: Optional[ + Union[bool, LinkedEditingRangeOptions, LinkedEditingRangeRegistrationOptions] + ] = attrs.field(default=None) + """The server provides linked editing range support. + + @since 3.16.0""" + # Since: 3.16.0 + + semantic_tokens_provider: Optional[ + Union[SemanticTokensOptions, SemanticTokensRegistrationOptions] + ] = attrs.field(default=None) + """The server provides semantic tokens support. + + @since 3.16.0""" + # Since: 3.16.0 + + moniker_provider: Optional[ + Union[bool, MonikerOptions, MonikerRegistrationOptions] + ] = attrs.field(default=None) + """The server provides moniker support. + + @since 3.16.0""" + # Since: 3.16.0 + + type_hierarchy_provider: Optional[ + Union[bool, TypeHierarchyOptions, TypeHierarchyRegistrationOptions] + ] = attrs.field(default=None) + """The server provides type hierarchy support. + + @since 3.17.0""" + # Since: 3.17.0 + + inline_value_provider: Optional[ + Union[bool, InlineValueOptions, InlineValueRegistrationOptions] + ] = attrs.field(default=None) + """The server provides inline values. + + @since 3.17.0""" + # Since: 3.17.0 + + inlay_hint_provider: Optional[ + Union[bool, InlayHintOptions, InlayHintRegistrationOptions] + ] = attrs.field(default=None) + """The server provides inlay hints. + + @since 3.17.0""" + # Since: 3.17.0 + + diagnostic_provider: Optional[ + Union[DiagnosticOptions, DiagnosticRegistrationOptions] + ] = attrs.field(default=None) + """The server has support for pull model diagnostics. + + @since 3.17.0""" + # Since: 3.17.0 + + inline_completion_provider: Optional[ + Union[bool, InlineCompletionOptions] + ] = attrs.field(default=None) + """Inline completion options used during static registration. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + + workspace: Optional["WorkspaceOptions"] = attrs.field(default=None) + """Workspace specific server capabilities.""" + + experimental: Optional[LSPAny] = attrs.field(default=None) + """Experimental server capabilities.""" + + +@attrs.define +class ServerInfo: + """Information about the server + + @since 3.15.0 + @since 3.18.0 ServerInfo type name added. + @proposed""" + + # Since: 3.18.0 ServerInfo type name added. + # Proposed + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of the server as defined by the server.""" + + version: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The server's version as defined by the server.""" + + +@attrs.define +class VersionedTextDocumentIdentifier: + """A text document identifier to denote a specific version of a text document.""" + + version: int = attrs.field(validator=validators.integer_validator) + """The version number of this document.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The text document's uri.""" + + +@attrs.define +class FileEvent: + """An event describing a file change.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The file's uri.""" + + type: FileChangeType = attrs.field() + """The change type.""" + + +@attrs.define +class FileSystemWatcher: + glob_pattern: GlobPattern = attrs.field() + """The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail. + + @since 3.17.0 support for relative patterns.""" + # Since: 3.17.0 support for relative patterns. + + kind: Optional[Union[WatchKind, int]] = attrs.field(default=None) + """The kind of events of interest. If omitted it defaults + to WatchKind.Create | WatchKind.Change | WatchKind.Delete + which is 7.""" + + +@attrs.define +class Diagnostic: + """Represents a diagnostic, such as a compiler error or warning. Diagnostic objects + are only valid in the scope of a resource.""" + + range: Range = attrs.field() + """The range at which the message applies""" + + message: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The diagnostic's message. It usually appears in the user interface""" + + severity: Optional[DiagnosticSeverity] = attrs.field(default=None) + """The diagnostic's severity. Can be omitted. If omitted it is up to the + client to interpret diagnostics as error, warning, info or hint.""" + + code: Optional[Union[int, str]] = attrs.field(default=None) + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Optional["CodeDescription"] = attrs.field(default=None) + """An optional property to describe the error code. + Requires the code field (above) to be present/not null. + + @since 3.16.0""" + # Since: 3.16.0 + + source: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A human-readable string describing the source of this + diagnostic, e.g. 'typescript' or 'super lint'. It usually + appears in the user interface.""" + + tags: Optional[Sequence[DiagnosticTag]] = attrs.field(default=None) + """Additional metadata about the diagnostic. + + @since 3.15.0""" + # Since: 3.15.0 + + related_information: Optional[ + Sequence["DiagnosticRelatedInformation"] + ] = attrs.field(default=None) + """An array of related diagnostic information, e.g. when symbol-names within + a scope collide all definitions can be marked via this property.""" + + data: Optional[LSPAny] = attrs.field(default=None) + """A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class CompletionContext: + """Contains additional information about the context in which a completion request is triggered.""" + + trigger_kind: CompletionTriggerKind = attrs.field() + """How the completion was triggered.""" + + trigger_character: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The trigger character (a single character) that has trigger code complete. + Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`""" + + +@attrs.define +class CompletionItemLabelDetails: + """Additional details for a completion item label. + + @since 3.17.0""" + + # Since: 3.17.0 + + detail: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional string which is rendered less prominently directly after {@link CompletionItem.label label}, + without any spacing. Should be used for function signatures and type annotations.""" + + description: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used + for fully qualified names and file paths.""" + + +@attrs.define +class InsertReplaceEdit: + """A special text edit to provide an insert and a replace operation. + + @since 3.16.0""" + + # Since: 3.16.0 + + new_text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The string to be inserted.""" + + insert: Range = attrs.field() + """The range if the insert is requested""" + + replace: Range = attrs.field() + """The range if the replace is requested.""" + + +@attrs.define +class CompletionItemDefaults: + """In many cases the items of an actual completion result share the same + value for properties like `commitCharacters` or the range of a text + edit. A completion list can therefore define item defaults which will + be used if a completion item itself doesn't specify the value. + + If a completion list specifies a default value and a completion item + also specifies a corresponding value the one from the item is used. + + Servers are only allowed to return default values if the client + signals support for this via the `completionList.itemDefaults` + capability. + + @since 3.17.0""" + + # Since: 3.17.0 + + commit_characters: Optional[Sequence[str]] = attrs.field(default=None) + """A default commit character set. + + @since 3.17.0""" + # Since: 3.17.0 + + edit_range: Optional[Union[Range, "EditRangeWithInsertReplace"]] = attrs.field( + default=None + ) + """A default edit range. + + @since 3.17.0""" + # Since: 3.17.0 + + insert_text_format: Optional[InsertTextFormat] = attrs.field(default=None) + """A default insert text format. + + @since 3.17.0""" + # Since: 3.17.0 + + insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) + """A default insert text mode. + + @since 3.17.0""" + # Since: 3.17.0 + + data: Optional[LSPAny] = attrs.field(default=None) + """A default data value. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class SignatureHelpContext: + """Additional information about the context in which a signature help request was triggered. + + @since 3.15.0""" + + # Since: 3.15.0 + + trigger_kind: SignatureHelpTriggerKind = attrs.field() + """Action that caused signature help to be triggered.""" + + is_retrigger: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """`true` if signature help was already showing when it was triggered. + + Retriggers occurs when the signature help is already active and can be caused by actions such as + typing a trigger character, a cursor move, or document content changes.""" + + trigger_character: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """Character that caused signature help to be triggered. + + This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`""" + + active_signature_help: Optional[SignatureHelp] = attrs.field(default=None) + """The currently active `SignatureHelp`. + + The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on + the user navigating through available signatures.""" + + +@attrs.define +class SignatureInformation: + """Represents the signature of something callable. A signature + can have a label, like a function-name, a doc-comment, and + a set of parameters.""" + + label: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The label of this signature. Will be shown in + the UI.""" + + documentation: Optional[Union[str, MarkupContent]] = attrs.field(default=None) + """The human-readable doc-comment of this signature. Will be shown + in the UI but can be omitted.""" + + parameters: Optional[Sequence["ParameterInformation"]] = attrs.field(default=None) + """The parameters of this signature.""" + + active_parameter: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The index of the active parameter. + + If provided, this is used in place of `SignatureHelp.activeParameter`. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class ReferenceContext: + """Value-object that contains additional information when + requesting references.""" + + include_declaration: bool = attrs.field( + validator=attrs.validators.instance_of(bool) + ) + """Include the declaration of the current symbol.""" + + +@attrs.define +class CodeActionContext: + """Contains additional diagnostic information about the context in which + a {@link CodeActionProvider.provideCodeActions code action} is run.""" + + diagnostics: Sequence[Diagnostic] = attrs.field() + """An array of diagnostics known on the client side overlapping the range provided to the + `textDocument/codeAction` request. They are provided so that the server knows which + errors are currently presented to the user for the given range. There is no guarantee + that these accurately reflect the error state of the resource. The primary parameter + to compute code actions is the provided range.""" + + only: Optional[Sequence[Union[CodeActionKind, str]]] = attrs.field(default=None) + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So servers + can omit computing them.""" + + trigger_kind: Optional[CodeActionTriggerKind] = attrs.field(default=None) + """The reason why code actions were requested. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class CodeActionDisabled: + """Captures why the code action is currently disabled. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + reason: str = attrs.field(validator=attrs.validators.instance_of(str)) + """Human readable description of why the code action is currently disabled. + + This is displayed in the code actions UI.""" + + +@attrs.define +class LocationUriOnly: + """Location with only uri and does not include range. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + + +@attrs.define +class FormattingOptions: + """Value-object describing what options formatting should use.""" + + tab_size: int = attrs.field(validator=validators.uinteger_validator) + """Size of a tab in spaces.""" + + insert_spaces: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """Prefer spaces over tabs.""" + + trim_trailing_whitespace: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Trim trailing whitespace on a line. + + @since 3.15.0""" + # Since: 3.15.0 + + insert_final_newline: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Insert a newline character at the end of the file if one does not exist. + + @since 3.15.0""" + # Since: 3.15.0 + + trim_final_newlines: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Trim all newlines after the final newline at the end of the file. + + @since 3.15.0""" + # Since: 3.15.0 + + +@attrs.define +class PrepareRenamePlaceholder: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + range: Range = attrs.field() + + placeholder: str = attrs.field(validator=attrs.validators.instance_of(str)) + + +@attrs.define +class PrepareRenameDefaultBehavior: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + default_behavior: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + + +@attrs.define +class SemanticTokensLegend: + """@since 3.16.0""" + + # Since: 3.16.0 + + token_types: Sequence[str] = attrs.field() + """The token types a server uses.""" + + token_modifiers: Sequence[str] = attrs.field() + """The token modifiers a server uses.""" + + +@attrs.define +class SemanticTokensFullDelta: + """Semantic tokens options to support deltas for full documents + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + delta: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server supports deltas for full documents.""" + + +@attrs.define +class OptionalVersionedTextDocumentIdentifier: + """A text document identifier to optionally denote a specific version of a text document.""" + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The text document's uri.""" + + version: Optional[Union[int, None]] = attrs.field(default=None) + """The version number of this document. If a versioned text document identifier + is sent from the server to the client and the file is not open in the editor + (the server has not received an open notification before) the server can send + `null` to indicate that the version is unknown and the content on disk is the + truth (as specified with document content ownership).""" + + +@attrs.define +class AnnotatedTextEdit: + """A special text edit with an additional change annotation. + + @since 3.16.0.""" + + # Since: 3.16.0. + + annotation_id: ChangeAnnotationIdentifier = attrs.field() + """The actual identifier of the change annotation""" + + range: Range = attrs.field() + """The range of the text document to be manipulated. To insert + text into a document create a range where start === end.""" + + new_text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The string to be inserted. For delete operations use an + empty string.""" + + +@attrs.define +class CreateFileOptions: + """Options to create a file.""" + + overwrite: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Overwrite existing file. Overwrite wins over `ignoreIfExists`""" + + ignore_if_exists: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Ignore if exists.""" + + +@attrs.define +class RenameFileOptions: + """Rename file options""" + + overwrite: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Overwrite target if existing. Overwrite wins over `ignoreIfExists`""" + + ignore_if_exists: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Ignores if target exists.""" + + +@attrs.define +class DeleteFileOptions: + """Delete file options""" + + recursive: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Delete the content recursively if a folder is denoted.""" + + ignore_if_not_exists: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Ignore the operation if the file doesn't exist.""" + + +@attrs.define +class FileOperationPattern: + """A pattern to describe in which file operation requests or notifications + the server is interested in receiving. + + @since 3.16.0""" + + # Since: 3.16.0 + + glob: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The glob pattern to match. Glob patterns can have the following syntax: + - `*` to match one or more characters in a path segment + - `?` to match on one character in a path segment + - `**` to match any number of path segments, including none + - `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files) + - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) + - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)""" + + matches: Optional[FileOperationPatternKind] = attrs.field(default=None) + """Whether to match files or folders with this pattern. + + Matches both if undefined.""" + + options: Optional["FileOperationPatternOptions"] = attrs.field(default=None) + """Additional options used during matching.""" + + +@attrs.define +class WorkspaceFullDocumentDiagnosticReport: + """A full document diagnostic report for a workspace diagnostic result. + + @since 3.17.0""" + + # Since: 3.17.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The URI for which diagnostic information is reported.""" + + items: Sequence[Diagnostic] = attrs.field() + """The actual items.""" + + version: Optional[Union[int, None]] = attrs.field(default=None) + """The version number for which the diagnostics are reported. + If the document is not marked as open `null` can be provided.""" + + kind: str = attrs.field(validator=attrs.validators.in_(["full"]), default="full") + """A full document diagnostic report.""" + + result_id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """An optional result id. If provided it will + be sent on the next diagnostic request for the + same document.""" + + +@attrs.define +class WorkspaceUnchangedDocumentDiagnosticReport: + """An unchanged document diagnostic report for a workspace diagnostic result. + + @since 3.17.0""" + + # Since: 3.17.0 + + uri: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The URI for which diagnostic information is reported.""" + + result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A result id which will be sent on the next + diagnostic request for the same document.""" + + version: Optional[Union[int, None]] = attrs.field(default=None) + """The version number for which the diagnostics are reported. + If the document is not marked as open `null` can be provided.""" + + kind: str = attrs.field( + validator=attrs.validators.in_(["unchanged"]), default="unchanged" + ) + """A document diagnostic report indicating + no changes to the last result. A server can + only return `unchanged` if result ids are + provided.""" + + +@attrs.define +class NotebookCell: + """A notebook cell. + + A cell's document URI must be unique across ALL notebook + cells and can therefore be used to uniquely identify a + notebook cell or the cell's text document. + + @since 3.17.0""" + + # Since: 3.17.0 + + kind: NotebookCellKind = attrs.field() + """The cell's kind""" + + document: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The URI of the cell's text document + content.""" + + metadata: Optional[LSPObject] = attrs.field(default=None) + """Additional metadata stored with the cell. + + Note: should always be an object literal (e.g. LSPObject)""" + + execution_summary: Optional["ExecutionSummary"] = attrs.field(default=None) + """Additional execution summary information + if supported by the client.""" + + +@attrs.define +class NotebookDocumentCellChanges: + """Cell changes to a notebook document. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + structure: Optional["NotebookDocumentCellChangeStructure"] = attrs.field( + default=None + ) + """Changes to the cell structure to add or + remove cells.""" + + data: Optional[Sequence[NotebookCell]] = attrs.field(default=None) + """Changes to notebook cells properties like its + kind, execution summary or metadata.""" + + text_content: Optional[ + Sequence["NotebookDocumentCellContentChanges"] + ] = attrs.field(default=None) + """Changes to the text content of notebook cells.""" + + +@attrs.define +class SelectedCompletionInfo: + """Describes the currently selected completion item. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + range: Range = attrs.field() + """The range that will be replaced if this completion item is accepted.""" + + text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The text the range will be replaced with if this completion is accepted.""" + + +@attrs.define +class ClientInfo: + """Information about the client + + @since 3.15.0 + @since 3.18.0 ClientInfo type name added. + @proposed""" + + # Since: 3.18.0 ClientInfo type name added. + # Proposed + + name: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of the client as defined by the client.""" + + version: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The client's version as defined by the client.""" + + +@attrs.define +class ClientCapabilities: + """Defines the capabilities provided by the client.""" + + workspace: Optional["WorkspaceClientCapabilities"] = attrs.field(default=None) + """Workspace specific client capabilities.""" + + text_document: Optional["TextDocumentClientCapabilities"] = attrs.field( + default=None + ) + """Text document specific client capabilities.""" + + notebook_document: Optional["NotebookDocumentClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the notebook document support. + + @since 3.17.0""" + # Since: 3.17.0 + + window: Optional["WindowClientCapabilities"] = attrs.field(default=None) + """Window specific client capabilities.""" + + general: Optional["GeneralClientCapabilities"] = attrs.field(default=None) + """General client capabilities. + + @since 3.16.0""" + # Since: 3.16.0 + + experimental: Optional[LSPAny] = attrs.field(default=None) + """Experimental client capabilities.""" + + +@attrs.define +class TextDocumentSyncOptions: + open_close: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Open and close notifications are sent to the server. If omitted open close notification should not + be sent.""" + + change: Optional[TextDocumentSyncKind] = attrs.field(default=None) + """Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full + and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.""" + + will_save: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """If present will save notifications are sent to the server. If omitted the notification should not be + sent.""" + + will_save_wait_until: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """If present will save wait until requests are sent to the server. If omitted the request should not be + sent.""" + + save: Optional[Union[bool, SaveOptions]] = attrs.field(default=None) + """If present save notifications are sent to the server. If omitted the notification should not be + sent.""" + + +@attrs.define +class NotebookDocumentSyncOptions: + """Options specific to a notebook plus its cells + to be synced to the server. + + If a selector provides a notebook document + filter but no cell selector all cells of a + matching notebook document will be synced. + + If a selector provides no notebook document + filter but only a cell selector all notebook + document that contain at least one matching + cell will be synced. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_selector: Sequence[ + Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] + ] = attrs.field() + """The notebooks to be synced""" + + save: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether save notification should be forwarded to + the server. Will only be honored if mode === `notebook`.""" + + +@attrs.define +class NotebookDocumentSyncRegistrationOptions: + """Registration options specific to a notebook. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook_selector: Sequence[ + Union["NotebookDocumentFilterWithNotebook", "NotebookDocumentFilterWithCells"] + ] = attrs.field() + """The notebooks to be synced""" + + save: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether save notification should be forwarded to + the server. Will only be honored if mode === `notebook`.""" + + id: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The id used to register the request. The id can be used to deregister + the request again. See also Registration#id.""" + + +@attrs.define +class WorkspaceOptions: + """Defines workspace specific capabilities of the server. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + workspace_folders: Optional["WorkspaceFoldersServerCapabilities"] = attrs.field( + default=None + ) + """The server supports workspace folder. + + @since 3.6.0""" + # Since: 3.6.0 + + file_operations: Optional["FileOperationOptions"] = attrs.field(default=None) + """The server is interested in notifications/requests for operations on files. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class TextDocumentContentChangePartial: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + range: Range = attrs.field() + """The range of the document that changed.""" + + text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The new text for the provided range.""" + + range_length: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The optional length of the range that got replaced. + + @deprecated use range instead.""" + + +@attrs.define +class TextDocumentContentChangeWholeDocument: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + text: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The new text of the whole document.""" + + +@attrs.define +class CodeDescription: + """Structure to capture a description for an error code. + + @since 3.16.0""" + + # Since: 3.16.0 + + href: str = attrs.field(validator=attrs.validators.instance_of(str)) + """An URI to open with more information about the diagnostic error.""" + + +@attrs.define +class DiagnosticRelatedInformation: + """Represents a related message and source code location for a diagnostic. This should be + used to point to code locations that cause or related to a diagnostics, e.g when duplicating + a symbol in a scope.""" + + location: Location = attrs.field() + """The location of this related diagnostic information.""" + + message: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The message of this related diagnostic information.""" + + +@attrs.define +class EditRangeWithInsertReplace: + """Edit range variant that includes ranges for insert and replace operations. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + insert: Range = attrs.field() + + replace: Range = attrs.field() + + +@attrs.define +class ServerCompletionItemOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + label_details_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server has support for completion item label + details (see also `CompletionItemLabelDetails`) when + receiving a completion item in a resolve call. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class MarkedStringWithLanguage: + """@since 3.18.0 + @proposed + @deprecated use MarkupContent instead.""" + + # Since: 3.18.0 + # Proposed + + language: str = attrs.field(validator=attrs.validators.instance_of(str)) + + value: str = attrs.field(validator=attrs.validators.instance_of(str)) + + +@attrs.define +class ParameterInformation: + """Represents a parameter of a callable-signature. A parameter can + have a label and a doc-comment.""" + + label: Union[str, Tuple[int, int]] = attrs.field() + """The label of this parameter information. + + Either a string or an inclusive start and exclusive end offsets within its containing + signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 + string representation as `Position` and `Range` does. + + *Note*: a label of type string should be a substring of its containing signature label. + Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.""" + + documentation: Optional[Union[str, MarkupContent]] = attrs.field(default=None) + """The human-readable doc-comment of this parameter. Will be shown + in the UI but can be omitted.""" + + +@attrs.define +class NotebookCellTextDocumentFilter: + """A notebook cell text document filter denotes a cell text + document by different properties. + + @since 3.17.0""" + + # Since: 3.17.0 + + notebook: Union[str, NotebookDocumentFilter] = attrs.field() + """A filter that matches against the notebook + containing the notebook cell. If a string + value is provided it matches against the + notebook type. '*' matches every notebook.""" + + language: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A language id like `python`. + + Will be matched against the language id of the + notebook cell document. '*' matches every language.""" + + +@attrs.define +class FileOperationPatternOptions: + """Matching options for the file operation pattern. + + @since 3.16.0""" + + # Since: 3.16.0 + + ignore_case: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The pattern should be matched ignoring casing.""" + + +@attrs.define +class ExecutionSummary: + execution_order: int = attrs.field(validator=validators.uinteger_validator) + """A strict monotonically increasing value + indicating the execution order of a cell + inside a notebook.""" + + success: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the execution was successful or + not if known by the client.""" + + +@attrs.define +class NotebookDocumentCellChangeStructure: + """Structural changes to cells in a notebook document. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + array: "NotebookCellArrayChange" = attrs.field() + """The change to the cell array.""" + + did_open: Optional[Sequence[TextDocumentItem]] = attrs.field(default=None) + """Additional opened cell text documents.""" + + did_close: Optional[Sequence[TextDocumentIdentifier]] = attrs.field(default=None) + """Additional closed cell text documents.""" + + +@attrs.define +class NotebookDocumentCellContentChanges: + """Content changes to a cell in a notebook document. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + document: VersionedTextDocumentIdentifier = attrs.field() + + changes: Sequence[TextDocumentContentChangeEvent] = attrs.field() + + +@attrs.define +class WorkspaceClientCapabilities: + """Workspace specific client capabilities.""" + + apply_edit: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports applying batch edits + to the workspace by supporting the request + 'workspace/applyEdit'""" + + workspace_edit: Optional["WorkspaceEditClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to `WorkspaceEdit`s.""" + + did_change_configuration: Optional[ + "DidChangeConfigurationClientCapabilities" + ] = attrs.field(default=None) + """Capabilities specific to the `workspace/didChangeConfiguration` notification.""" + + did_change_watched_files: Optional[ + "DidChangeWatchedFilesClientCapabilities" + ] = attrs.field(default=None) + """Capabilities specific to the `workspace/didChangeWatchedFiles` notification.""" + + symbol: Optional["WorkspaceSymbolClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `workspace/symbol` request.""" + + execute_command: Optional["ExecuteCommandClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `workspace/executeCommand` request.""" + + workspace_folders: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for workspace folders. + + @since 3.6.0""" + # Since: 3.6.0 + + configuration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports `workspace/configuration` requests. + + @since 3.6.0""" + # Since: 3.6.0 + + semantic_tokens: Optional[ + "SemanticTokensWorkspaceClientCapabilities" + ] = attrs.field(default=None) + """Capabilities specific to the semantic token requests scoped to the + workspace. + + @since 3.16.0.""" + # Since: 3.16.0. + + code_lens: Optional["CodeLensWorkspaceClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the code lens requests scoped to the + workspace. + + @since 3.16.0.""" + # Since: 3.16.0. + + file_operations: Optional["FileOperationClientCapabilities"] = attrs.field( + default=None + ) + """The client has support for file notifications/requests for user operations on files. + + Since 3.16.0""" + + inline_value: Optional["InlineValueWorkspaceClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the inline values requests scoped to the + workspace. + + @since 3.17.0.""" + # Since: 3.17.0. + + inlay_hint: Optional["InlayHintWorkspaceClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the inlay hint requests scoped to the + workspace. + + @since 3.17.0.""" + # Since: 3.17.0. + + diagnostics: Optional["DiagnosticWorkspaceClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the diagnostic requests scoped to the + workspace. + + @since 3.17.0.""" + # Since: 3.17.0. + + folding_range: Optional["FoldingRangeWorkspaceClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the folding range requests scoped to the workspace. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + + +@attrs.define +class TextDocumentClientCapabilities: + """Text document specific client capabilities.""" + + synchronization: Optional["TextDocumentSyncClientCapabilities"] = attrs.field( + default=None + ) + """Defines which synchronization capabilities the client supports.""" + + completion: Optional["CompletionClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/completion` request.""" + + hover: Optional["HoverClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/hover` request.""" + + signature_help: Optional["SignatureHelpClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/signatureHelp` request.""" + + declaration: Optional["DeclarationClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/declaration` request. + + @since 3.14.0""" + # Since: 3.14.0 + + definition: Optional["DefinitionClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/definition` request.""" + + type_definition: Optional["TypeDefinitionClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/typeDefinition` request. + + @since 3.6.0""" + # Since: 3.6.0 + + implementation: Optional["ImplementationClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/implementation` request. + + @since 3.6.0""" + # Since: 3.6.0 + + references: Optional["ReferenceClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/references` request.""" + + document_highlight: Optional["DocumentHighlightClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/documentHighlight` request.""" + + document_symbol: Optional["DocumentSymbolClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/documentSymbol` request.""" + + code_action: Optional["CodeActionClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/codeAction` request.""" + + code_lens: Optional["CodeLensClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/codeLens` request.""" + + document_link: Optional["DocumentLinkClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/documentLink` request.""" + + color_provider: Optional["DocumentColorClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/documentColor` and the + `textDocument/colorPresentation` request. + + @since 3.6.0""" + # Since: 3.6.0 + + formatting: Optional["DocumentFormattingClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/formatting` request.""" + + range_formatting: Optional[ + "DocumentRangeFormattingClientCapabilities" + ] = attrs.field(default=None) + """Capabilities specific to the `textDocument/rangeFormatting` request.""" + + on_type_formatting: Optional[ + "DocumentOnTypeFormattingClientCapabilities" + ] = attrs.field(default=None) + """Capabilities specific to the `textDocument/onTypeFormatting` request.""" + + rename: Optional["RenameClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/rename` request.""" + + folding_range: Optional["FoldingRangeClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/foldingRange` request. + + @since 3.10.0""" + # Since: 3.10.0 + + selection_range: Optional["SelectionRangeClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/selectionRange` request. + + @since 3.15.0""" + # Since: 3.15.0 + + publish_diagnostics: Optional["PublishDiagnosticsClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the `textDocument/publishDiagnostics` notification.""" + + call_hierarchy: Optional["CallHierarchyClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the various call hierarchy requests. + + @since 3.16.0""" + # Since: 3.16.0 + + semantic_tokens: Optional["SemanticTokensClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the various semantic token request. + + @since 3.16.0""" + # Since: 3.16.0 + + linked_editing_range: Optional[ + "LinkedEditingRangeClientCapabilities" + ] = attrs.field(default=None) + """Capabilities specific to the `textDocument/linkedEditingRange` request. + + @since 3.16.0""" + # Since: 3.16.0 + + moniker: Optional["MonikerClientCapabilities"] = attrs.field(default=None) + """Client capabilities specific to the `textDocument/moniker` request. + + @since 3.16.0""" + # Since: 3.16.0 + + type_hierarchy: Optional["TypeHierarchyClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the various type hierarchy requests. + + @since 3.17.0""" + # Since: 3.17.0 + + inline_value: Optional["InlineValueClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/inlineValue` request. + + @since 3.17.0""" + # Since: 3.17.0 + + inlay_hint: Optional["InlayHintClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the `textDocument/inlayHint` request. + + @since 3.17.0""" + # Since: 3.17.0 + + diagnostic: Optional["DiagnosticClientCapabilities"] = attrs.field(default=None) + """Capabilities specific to the diagnostic pull model. + + @since 3.17.0""" + # Since: 3.17.0 + + inline_completion: Optional["InlineCompletionClientCapabilities"] = attrs.field( + default=None + ) + """Client capabilities specific to inline completions. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + + +@attrs.define +class NotebookDocumentClientCapabilities: + """Capabilities specific to the notebook document support. + + @since 3.17.0""" + + # Since: 3.17.0 + + synchronization: "NotebookDocumentSyncClientCapabilities" = attrs.field() + """Capabilities specific to notebook document synchronization + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class WindowClientCapabilities: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """It indicates whether the client supports server initiated + progress using the `window/workDoneProgress/create` request. + + The capability also controls Whether client supports handling + of progress notifications. If set servers are allowed to report a + `workDoneProgress` property in the request specific server + capabilities. + + @since 3.15.0""" + # Since: 3.15.0 + + show_message: Optional["ShowMessageRequestClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the showMessage request. + + @since 3.16.0""" + # Since: 3.16.0 + + show_document: Optional["ShowDocumentClientCapabilities"] = attrs.field( + default=None + ) + """Capabilities specific to the showDocument request. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class GeneralClientCapabilities: + """General client capabilities. + + @since 3.16.0""" + + # Since: 3.16.0 + + stale_request_support: Optional["StaleRequestSupportOptions"] = attrs.field( + default=None + ) + """Client capability that signals how the client + handles stale requests (e.g. a request + for which the client will not process the response + anymore since the information is outdated). + + @since 3.17.0""" + # Since: 3.17.0 + + regular_expressions: Optional["RegularExpressionsClientCapabilities"] = attrs.field( + default=None + ) + """Client capabilities specific to regular expressions. + + @since 3.16.0""" + # Since: 3.16.0 + + markdown: Optional["MarkdownClientCapabilities"] = attrs.field(default=None) + """Client capabilities specific to the client's markdown parser. + + @since 3.16.0""" + # Since: 3.16.0 + + position_encodings: Optional[ + Sequence[Union[PositionEncodingKind, str]] + ] = attrs.field(default=None) + """The position encodings supported by the client. Client and server + have to agree on the same position encoding to ensure that offsets + (e.g. character position in a line) are interpreted the same on both + sides. + + To keep the protocol backwards compatible the following applies: if + the value 'utf-16' is missing from the array of position encodings + servers can assume that the client supports UTF-16. UTF-16 is + therefore a mandatory encoding. + + If omitted it defaults to ['utf-16']. + + Implementation considerations: since the conversion from one encoding + into another requires the content of the file / line the conversion + is best done where the file is read which is usually on the server + side. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class NotebookDocumentFilterWithNotebook: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + notebook: Union[str, NotebookDocumentFilter] = attrs.field() + """The notebook to be synced If a string + value is provided it matches against the + notebook type. '*' matches every notebook.""" + + cells: Optional[Sequence["NotebookCellLanguage"]] = attrs.field(default=None) + """The cells of the matching notebook to be synced.""" + + +@attrs.define +class NotebookDocumentFilterWithCells: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + cells: Sequence["NotebookCellLanguage"] = attrs.field() + """The cells of the matching notebook to be synced.""" + + notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) + """The notebook to be synced If a string + value is provided it matches against the + notebook type. '*' matches every notebook.""" + + +@attrs.define +class WorkspaceFoldersServerCapabilities: + supported: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The server has support for workspace folders""" + + change_notifications: Optional[Union[str, bool]] = attrs.field(default=None) + """Whether the server wants to receive workspace folder + change notifications. + + If a string is provided the string is treated as an ID + under which the notification is registered on the client + side. The ID can be used to unregister for these events + using the `client/unregisterCapability` request.""" + + +@attrs.define +class FileOperationOptions: + """Options for notifications/requests for user operations on files. + + @since 3.16.0""" + + # Since: 3.16.0 + + did_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving didCreateFiles notifications.""" + + will_create: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving willCreateFiles requests.""" + + did_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving didRenameFiles notifications.""" + + will_rename: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving willRenameFiles requests.""" + + did_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving didDeleteFiles file notifications.""" + + will_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) + """The server is interested in receiving willDeleteFiles file requests.""" + + +@attrs.define +class RelativePattern: + """A relative pattern is a helper to construct glob patterns that are matched + relatively to a base URI. The common value for a `baseUri` is a workspace + folder root, but it can be another absolute URI as well. + + @since 3.17.0""" + + # Since: 3.17.0 + + base_uri: Union[WorkspaceFolder, str] = attrs.field() + """A workspace folder or a base URI to which this pattern will be matched + against relatively.""" + + pattern: Pattern = attrs.field() + """The actual glob pattern;""" + + +@attrs.define +class TextDocumentFilterLanguage: + """A document filter where `language` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + language: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A language id, like `typescript`.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" + + +@attrs.define +class TextDocumentFilterScheme: + """A document filter where `scheme` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + language: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A language id, like `typescript`.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" + + +@attrs.define +class TextDocumentFilterPattern: + """A document filter where `pattern` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.""" + + language: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A language id, like `typescript`.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + +@attrs.define +class NotebookCellArrayChange: + """A change describing how to move a `NotebookCell` + array from state S to S'. + + @since 3.17.0""" + + # Since: 3.17.0 + + start: int = attrs.field(validator=validators.uinteger_validator) + """The start oftest of the cell that changed.""" + + delete_count: int = attrs.field(validator=validators.uinteger_validator) + """The deleted cells""" + + cells: Optional[Sequence[NotebookCell]] = attrs.field(default=None) + """The new cells, if any""" + + +@attrs.define +class WorkspaceEditClientCapabilities: + document_changes: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports versioned document changes in `WorkspaceEdit`s""" + + resource_operations: Optional[Sequence[ResourceOperationKind]] = attrs.field( + default=None + ) + """The resource operations the client supports. Clients should at least + support 'create', 'rename' and 'delete' files and folders. + + @since 3.13.0""" + # Since: 3.13.0 + + failure_handling: Optional[FailureHandlingKind] = attrs.field(default=None) + """The failure handling strategy of a client if applying the workspace edit + fails. + + @since 3.13.0""" + # Since: 3.13.0 + + normalizes_line_endings: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client normalizes line endings to the client specific + setting. + If set to `true` the client will normalize line ending characters + in a workspace edit to the client-specified new line + character. + + @since 3.16.0""" + # Since: 3.16.0 + + change_annotation_support: Optional[ + "ChangeAnnotationsSupportOptions" + ] = attrs.field(default=None) + """Whether the client in general supports change annotations on text edits, + create file, rename file and delete file changes. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class DidChangeConfigurationClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Did change configuration notification supports dynamic registration.""" + + +@attrs.define +class DidChangeWatchedFilesClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Did change watched files notification supports dynamic registration. Please note + that the current protocol doesn't support static configuration for file changes + from the server side.""" + + relative_pattern_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client has support for {@link RelativePattern relative pattern} + or not. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class WorkspaceSymbolClientCapabilities: + """Client capabilities for a {@link WorkspaceSymbolRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Symbol request supports dynamic registration.""" + + symbol_kind: Optional["ClientSymbolKindOptions"] = attrs.field(default=None) + """Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.""" + + tag_support: Optional["ClientSymbolTagOptions"] = attrs.field(default=None) + """The client supports tags on `SymbolInformation`. + Clients supporting tags have to handle unknown tags gracefully. + + @since 3.16.0""" + # Since: 3.16.0 + + resolve_support: Optional["ClientSymbolResolveOptions"] = attrs.field(default=None) + """The client support partial workspace symbols. The client will send the + request `workspaceSymbol/resolve` to the server to resolve additional + properties. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class ExecuteCommandClientCapabilities: + """The client capabilities of a {@link ExecuteCommandRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Execute command supports dynamic registration.""" + + +@attrs.define +class SemanticTokensWorkspaceClientCapabilities: + """@since 3.16.0""" + + # Since: 3.16.0 + + refresh_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client implementation supports a refresh request sent from + the server to the client. + + Note that this event is global and will force the client to refresh all + semantic tokens currently shown. It should be used with absolute care + and is useful for situation where a server for example detects a project + wide change that requires such a calculation.""" + + +@attrs.define +class CodeLensWorkspaceClientCapabilities: + """@since 3.16.0""" + + # Since: 3.16.0 + + refresh_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client implementation supports a refresh request sent from the + server to the client. + + Note that this event is global and will force the client to refresh all + code lenses currently shown. It should be used with absolute care and is + useful for situation where a server for example detect a project wide + change that requires such a calculation.""" + + +@attrs.define +class FileOperationClientCapabilities: + """Capabilities relating to events from file operations by the user in the client. + + These events do not come from the file system, they come from user operations + like renaming a file in the UI. + + @since 3.16.0""" + + # Since: 3.16.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client supports dynamic registration for file requests/notifications.""" + + did_create: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for sending didCreateFiles notifications.""" + + will_create: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for sending willCreateFiles requests.""" + + did_rename: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for sending didRenameFiles notifications.""" + + will_rename: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for sending willRenameFiles requests.""" + + did_delete: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for sending didDeleteFiles notifications.""" + + will_delete: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for sending willDeleteFiles requests.""" + + +@attrs.define +class InlineValueWorkspaceClientCapabilities: + """Client workspace capabilities specific to inline values. + + @since 3.17.0""" + + # Since: 3.17.0 + + refresh_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client implementation supports a refresh request sent from the + server to the client. + + Note that this event is global and will force the client to refresh all + inline values currently shown. It should be used with absolute care and is + useful for situation where a server for example detects a project wide + change that requires such a calculation.""" + + +@attrs.define +class InlayHintWorkspaceClientCapabilities: + """Client workspace capabilities specific to inlay hints. + + @since 3.17.0""" + + # Since: 3.17.0 + + refresh_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client implementation supports a refresh request sent from + the server to the client. + + Note that this event is global and will force the client to refresh all + inlay hints currently shown. It should be used with absolute care and + is useful for situation where a server for example detects a project wide + change that requires such a calculation.""" + + +@attrs.define +class DiagnosticWorkspaceClientCapabilities: + """Workspace client capabilities specific to diagnostic pull requests. + + @since 3.17.0""" + + # Since: 3.17.0 + + refresh_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client implementation supports a refresh request sent from + the server to the client. + + Note that this event is global and will force the client to refresh all + pulled diagnostics currently shown. It should be used with absolute care and + is useful for situation where a server for example detects a project wide + change that requires such a calculation.""" + + +@attrs.define +class FoldingRangeWorkspaceClientCapabilities: + """Client workspace capabilities specific to folding ranges + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + refresh_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client implementation supports a refresh request sent from the + server to the client. + + Note that this event is global and will force the client to refresh all + folding ranges currently shown. It should be used with absolute care and is + useful for situation where a server for example detects a project wide + change that requires such a calculation. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + + +@attrs.define +class TextDocumentSyncClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether text document synchronization supports dynamic registration.""" + + will_save: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports sending will save notifications.""" + + will_save_wait_until: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports sending a will save request and + waits for a response providing text edits which will + be applied to the document before it is saved.""" + + did_save: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports did save notifications.""" + + +@attrs.define +class CompletionClientCapabilities: + """Completion client capabilities""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether completion supports dynamic registration.""" + + completion_item: Optional["ClientCompletionItemOptions"] = attrs.field(default=None) + """The client supports the following `CompletionItem` specific + capabilities.""" + + completion_item_kind: Optional["ClientCompletionItemOptionsKind"] = attrs.field( + default=None + ) + + insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) + """Defines how the client handles whitespace and indentation + when accepting a completion item that uses multi line + text in either `insertText` or `textEdit`. + + @since 3.17.0""" + # Since: 3.17.0 + + context_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports to send additional context information for a + `textDocument/completion` request.""" + + completion_list: Optional["CompletionListCapabilities"] = attrs.field(default=None) + """The client supports the following `CompletionList` specific + capabilities. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class HoverClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether hover supports dynamic registration.""" + + content_format: Optional[Sequence[MarkupKind]] = attrs.field(default=None) + """Client supports the following content formats for the content + property. The order describes the preferred format of the client.""" + + +@attrs.define +class SignatureHelpClientCapabilities: + """Client Capabilities for a {@link SignatureHelpRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether signature help supports dynamic registration.""" + + signature_information: Optional["ClientSignatureInformationOptions"] = attrs.field( + default=None + ) + """The client supports the following `SignatureInformation` + specific properties.""" + + context_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports to send additional context information for a + `textDocument/signatureHelp` request. A client that opts into + contextSupport will also support the `retriggerCharacters` on + `SignatureHelpOptions`. + + @since 3.15.0""" + # Since: 3.15.0 + + +@attrs.define +class DeclarationClientCapabilities: + """@since 3.14.0""" + + # Since: 3.14.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether declaration supports dynamic registration. If this is set to `true` + the client supports the new `DeclarationRegistrationOptions` return value + for the corresponding server capability as well.""" + + link_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports additional metadata in the form of declaration links.""" + + +@attrs.define +class DefinitionClientCapabilities: + """Client Capabilities for a {@link DefinitionRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether definition supports dynamic registration.""" + + link_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports additional metadata in the form of definition links. + + @since 3.14.0""" + # Since: 3.14.0 + + +@attrs.define +class TypeDefinitionClientCapabilities: + """Since 3.6.0""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `TypeDefinitionRegistrationOptions` return value + for the corresponding server capability as well.""" + + link_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports additional metadata in the form of definition links. + + Since 3.14.0""" + + +@attrs.define +class ImplementationClientCapabilities: + """@since 3.6.0""" + + # Since: 3.6.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `ImplementationRegistrationOptions` return value + for the corresponding server capability as well.""" + + link_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports additional metadata in the form of definition links. + + @since 3.14.0""" + # Since: 3.14.0 + + +@attrs.define +class ReferenceClientCapabilities: + """Client Capabilities for a {@link ReferencesRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether references supports dynamic registration.""" + + +@attrs.define +class DocumentHighlightClientCapabilities: + """Client Capabilities for a {@link DocumentHighlightRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether document highlight supports dynamic registration.""" + + +@attrs.define +class DocumentSymbolClientCapabilities: + """Client Capabilities for a {@link DocumentSymbolRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether document symbol supports dynamic registration.""" + + symbol_kind: Optional["ClientSymbolKindOptions"] = attrs.field(default=None) + """Specific capabilities for the `SymbolKind` in the + `textDocument/documentSymbol` request.""" + + hierarchical_document_symbol_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports hierarchical document symbols.""" + + tag_support: Optional["ClientSymbolTagOptions"] = attrs.field(default=None) + """The client supports tags on `SymbolInformation`. Tags are supported on + `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + Clients supporting tags have to handle unknown tags gracefully. + + @since 3.16.0""" + # Since: 3.16.0 + + label_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports an additional label presented in the UI when + registering a document symbol provider. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class CodeActionClientCapabilities: + """The Client Capabilities of a {@link CodeActionRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether code action supports dynamic registration.""" + + code_action_literal_support: Optional[ + "ClientCodeActionLiteralOptions" + ] = attrs.field(default=None) + """The client support code action literals of type `CodeAction` as a valid + response of the `textDocument/codeAction` request. If the property is not + set the request can only return `Command` literals. + + @since 3.8.0""" + # Since: 3.8.0 + + is_preferred_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether code action supports the `isPreferred` property. + + @since 3.15.0""" + # Since: 3.15.0 + + disabled_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether code action supports the `disabled` property. + + @since 3.16.0""" + # Since: 3.16.0 + + data_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether code action supports the `data` property which is + preserved between a `textDocument/codeAction` and a + `codeAction/resolve` request. + + @since 3.16.0""" + # Since: 3.16.0 + + resolve_support: Optional["ClientCodeActionResolveOptions"] = attrs.field( + default=None + ) + """Whether the client supports resolving additional code action + properties via a separate `codeAction/resolve` request. + + @since 3.16.0""" + # Since: 3.16.0 + + honors_change_annotations: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client honors the change annotations in + text edits and resource operations returned via the + `CodeAction#edit` property by for example presenting + the workspace edit in the user interface and asking + for confirmation. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class CodeLensClientCapabilities: + """The client capabilities of a {@link CodeLensRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether code lens supports dynamic registration.""" + + +@attrs.define +class DocumentLinkClientCapabilities: + """The client capabilities of a {@link DocumentLinkRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether document link supports dynamic registration.""" + + tooltip_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client supports the `tooltip` property on `DocumentLink`. + + @since 3.15.0""" + # Since: 3.15.0 + + +@attrs.define +class DocumentColorClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `DocumentColorRegistrationOptions` return value + for the corresponding server capability as well.""" + + +@attrs.define +class DocumentFormattingClientCapabilities: + """Client capabilities of a {@link DocumentFormattingRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether formatting supports dynamic registration.""" + + +@attrs.define +class DocumentRangeFormattingClientCapabilities: + """Client capabilities of a {@link DocumentRangeFormattingRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether range formatting supports dynamic registration.""" + + ranges_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client supports formatting multiple ranges at once. + + @since 3.18.0 + @proposed""" + # Since: 3.18.0 + # Proposed + + +@attrs.define +class DocumentOnTypeFormattingClientCapabilities: + """Client capabilities of a {@link DocumentOnTypeFormattingRequest}.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether on type formatting supports dynamic registration.""" + + +@attrs.define +class RenameClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether rename supports dynamic registration.""" + + prepare_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports testing for validity of rename operations + before execution. + + @since 3.12.0""" + # Since: 3.12.0 + + prepare_support_default_behavior: Optional[ + PrepareSupportDefaultBehavior + ] = attrs.field(default=None) + """Client supports the default behavior result. + + The value indicates the default behavior used by the + client. + + @since 3.16.0""" + # Since: 3.16.0 + + honors_change_annotations: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client honors the change annotations in + text edits and resource operations returned via the + rename request's workspace edit by for example presenting + the workspace edit in the user interface and asking + for confirmation. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class FoldingRangeClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration for folding range + providers. If this is set to `true` the client supports the new + `FoldingRangeRegistrationOptions` return value for the corresponding + server capability as well.""" + + range_limit: Optional[int] = attrs.field( + validator=attrs.validators.optional(validators.uinteger_validator), default=None + ) + """The maximum number of folding ranges that the client prefers to receive + per document. The value serves as a hint, servers are free to follow the + limit.""" + + line_folding_only: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """If set, the client signals that it only supports folding complete lines. + If set, client will ignore specified `startCharacter` and `endCharacter` + properties in a FoldingRange.""" + + folding_range_kind: Optional["ClientFoldingRangeKindOptions"] = attrs.field( + default=None + ) + """Specific options for the folding range kind. + + @since 3.17.0""" + # Since: 3.17.0 + + folding_range: Optional["ClientFoldingRangeOptions"] = attrs.field(default=None) + """Specific options for the folding range. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class SelectionRangeClientCapabilities: + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration for selection range providers. If this is set to `true` + the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server + capability as well.""" + + +@attrs.define +class PublishDiagnosticsClientCapabilities: + """The publish diagnostic client capabilities.""" + + related_information: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the clients accepts diagnostics with related information.""" + + tag_support: Optional["ClientDiagnosticsTagOptions"] = attrs.field(default=None) + """Client supports the tag property to provide meta data about a diagnostic. + Clients supporting tags have to handle unknown tags gracefully. + + @since 3.15.0""" + # Since: 3.15.0 + + version_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client interprets the version property of the + `textDocument/publishDiagnostics` notification's parameter. + + @since 3.15.0""" + # Since: 3.15.0 + + code_description_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports a codeDescription property + + @since 3.16.0""" + # Since: 3.16.0 + + data_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether code action supports the `data` property which is + preserved between a `textDocument/publishDiagnostics` and + `textDocument/codeAction` request. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class CallHierarchyClientCapabilities: + """@since 3.16.0""" + + # Since: 3.16.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + return value for the corresponding server capability as well.""" + + +@attrs.define +class SemanticTokensClientCapabilities: + """@since 3.16.0""" + + # Since: 3.16.0 + + requests: "ClientSemanticTokensRequestOptions" = attrs.field() + """Which requests the client supports and might send to the server + depending on the server's capability. Please note that clients might not + show semantic tokens or degrade some of the user experience if a range + or full request is advertised by the client but not provided by the + server. If for example the client capability `requests.full` and + `request.range` are both set to true but the server only provides a + range provider the client might not render a minimap correctly or might + even decide to not show any semantic tokens at all.""" + + token_types: Sequence[str] = attrs.field() + """The token types that the client supports.""" + + token_modifiers: Sequence[str] = attrs.field() + """The token modifiers that the client supports.""" + + formats: Sequence[TokenFormat] = attrs.field() + """The token formats the clients supports.""" + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + return value for the corresponding server capability as well.""" + + overlapping_token_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client supports tokens that can overlap each other.""" + + multiline_token_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client supports tokens that can span multiple lines.""" + + server_cancel_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client allows the server to actively cancel a + semantic token request, e.g. supports returning + LSPErrorCodes.ServerCancelled. If a server does the client + needs to retrigger the request. + + @since 3.17.0""" + # Since: 3.17.0 + + augments_syntax_tokens: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client uses semantic tokens to augment existing + syntax tokens. If set to `true` client side created syntax + tokens and semantic tokens are both used for colorization. If + set to `false` the client only uses the returned semantic tokens + for colorization. + + If the value is `undefined` then the client behavior is not + specified. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class LinkedEditingRangeClientCapabilities: + """Client capabilities for the linked editing range request. + + @since 3.16.0""" + + # Since: 3.16.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + return value for the corresponding server capability as well.""" + + +@attrs.define +class MonikerClientCapabilities: + """Client capabilities specific to the moniker request. + + @since 3.16.0""" + + # Since: 3.16.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether moniker supports dynamic registration. If this is set to `true` + the client supports the new `MonikerRegistrationOptions` return value + for the corresponding server capability as well.""" + + +@attrs.define +class TypeHierarchyClientCapabilities: + """@since 3.17.0""" + + # Since: 3.17.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + return value for the corresponding server capability as well.""" + + +@attrs.define +class InlineValueClientCapabilities: + """Client capabilities specific to inline values. + + @since 3.17.0""" + + # Since: 3.17.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration for inline value providers.""" + + +@attrs.define +class InlayHintClientCapabilities: + """Inlay hint client capabilities. + + @since 3.17.0""" + + # Since: 3.17.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether inlay hints support dynamic registration.""" + + resolve_support: Optional["ClientInlayHintResolveOptions"] = attrs.field( + default=None + ) + """Indicates which properties a client can resolve lazily on an inlay + hint.""" + + +@attrs.define +class DiagnosticClientCapabilities: + """Client capabilities specific to diagnostic pull requests. + + @since 3.17.0""" + + # Since: 3.17.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is set to `true` + the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + return value for the corresponding server capability as well.""" + + related_document_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the clients supports related documents for document diagnostic pulls.""" + + +@attrs.define +class InlineCompletionClientCapabilities: + """Client capabilities specific to inline completions. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration for inline completion providers.""" + + +@attrs.define +class NotebookDocumentSyncClientCapabilities: + """Notebook specific client capabilities. + + @since 3.17.0""" + + # Since: 3.17.0 + + dynamic_registration: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether implementation supports dynamic registration. If this is + set to `true` the client supports the new + `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + return value for the corresponding server capability as well.""" + + execution_summary_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports sending execution summary data per cell.""" + + +@attrs.define +class ShowMessageRequestClientCapabilities: + """Show message request client capabilities""" + + message_action_item: Optional["ClientShowMessageActionItemOptions"] = attrs.field( + default=None + ) + """Capabilities specific to the `MessageActionItem` type.""" + + +@attrs.define +class ShowDocumentClientCapabilities: + """Client capabilities for the showDocument request. + + @since 3.16.0""" + + # Since: 3.16.0 + + support: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """The client has support for the showDocument + request.""" + + +@attrs.define +class StaleRequestSupportOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + cancel: bool = attrs.field(validator=attrs.validators.instance_of(bool)) + """The client will actively cancel the request.""" + + retry_on_content_modified: Sequence[str] = attrs.field() + """The list of requests for which the client + will retry the request if it receives a + response with error code `ContentModified`""" + + +@attrs.define +class RegularExpressionsClientCapabilities: + """Client capabilities specific to regular expressions. + + @since 3.16.0""" + + # Since: 3.16.0 + + engine: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The engine's name.""" + + version: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The engine's version.""" + + +@attrs.define +class MarkdownClientCapabilities: + """Client capabilities specific to the used markdown parser. + + @since 3.16.0""" + + # Since: 3.16.0 + + parser: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The name of the parser.""" + + version: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The version of the parser.""" + + allowed_tags: Optional[Sequence[str]] = attrs.field(default=None) + """A list of HTML tags that the client allows / supports in + Markdown. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class NotebookCellLanguage: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + language: str = attrs.field(validator=attrs.validators.instance_of(str)) + + +@attrs.define +class NotebookDocumentFilterNotebookType: + """A notebook document filter where `notebookType` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + notebook_type: str = attrs.field(validator=attrs.validators.instance_of(str)) + """The type of the enclosing notebook.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern.""" + + +@attrs.define +class NotebookDocumentFilterScheme: + """A notebook document filter where `scheme` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + scheme: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + notebook_type: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The type of the enclosing notebook.""" + + pattern: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A glob pattern.""" + + +@attrs.define +class NotebookDocumentFilterPattern: + """A notebook document filter where `pattern` is required field. + + @since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + pattern: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A glob pattern.""" + + notebook_type: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """The type of the enclosing notebook.""" + + scheme: Optional[str] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(str)), + default=None, + ) + """A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.""" + + +@attrs.define +class ChangeAnnotationsSupportOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + groups_on_label: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client groups edits with equal labels into tree nodes, + for instance all edits labelled with "Changes in Strings" would + be a tree node.""" + + +@attrs.define +class ClientSymbolKindOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Optional[Sequence[SymbolKind]] = attrs.field(default=None) + """The symbol kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown. + + If this property is not present the client only supports + the symbol kinds from `File` to `Array` as defined in + the initial version of the protocol.""" + + +@attrs.define +class ClientSymbolTagOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Sequence[SymbolTag] = attrs.field() + """The tags supported by the client.""" + + +@attrs.define +class ClientSymbolResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: Sequence[str] = attrs.field() + """The properties that a client can resolve lazily. Usually + `location.range`""" + + +@attrs.define +class ClientCompletionItemOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + snippet_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports snippets as insert text. + + A snippet can define tab stops and placeholders with `$1`, `$2` + and `${3:foo}`. `$0` defines the final tab stop, it defaults to + the end of the snippet. Placeholders with equal identifiers are linked, + that is typing in one will update others too.""" + + commit_characters_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports commit characters on a completion item.""" + + documentation_format: Optional[Sequence[MarkupKind]] = attrs.field(default=None) + """Client supports the following content formats for the documentation + property. The order describes the preferred format of the client.""" + + deprecated_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports the deprecated property on a completion item.""" + + preselect_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client supports the preselect property on a completion item.""" + + tag_support: Optional["CompletionItemTagOptions"] = attrs.field(default=None) + """Client supports the tag property on a completion item. Clients supporting + tags have to handle unknown tags gracefully. Clients especially need to + preserve unknown tags when sending a completion item back to the server in + a resolve call. + + @since 3.15.0""" + # Since: 3.15.0 + + insert_replace_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Client support insert replace edit to control different behavior if a + completion item is inserted in the text or should replace text. + + @since 3.16.0""" + # Since: 3.16.0 + + resolve_support: Optional["ClientCompletionItemResolveOptions"] = attrs.field( + default=None + ) + """Indicates which properties a client can resolve lazily on a completion + item. Before version 3.16.0 only the predefined properties `documentation` + and `details` could be resolved lazily. + + @since 3.16.0""" + # Since: 3.16.0 + + insert_text_mode_support: Optional[ + "ClientCompletionItemInsertTextModeOptions" + ] = attrs.field(default=None) + """The client supports the `insertTextMode` property on + a completion item to override the whitespace handling mode + as defined by the client (see `insertTextMode`). + + @since 3.16.0""" + # Since: 3.16.0 + + label_details_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client has support for completion item label + details (see also `CompletionItemLabelDetails`). + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class ClientCompletionItemOptionsKind: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Optional[Sequence[CompletionItemKind]] = attrs.field(default=None) + """The completion item kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown. + + If this property is not present the client only supports + the completion items kinds from `Text` to `Reference` as defined in + the initial version of the protocol.""" + + +@attrs.define +class CompletionListCapabilities: + """The client supports the following `CompletionList` specific + capabilities. + + @since 3.17.0""" + + # Since: 3.17.0 + + item_defaults: Optional[Sequence[str]] = attrs.field(default=None) + """The client supports the following itemDefaults on + a completion list. + + The value lists the supported property names of the + `CompletionList.itemDefaults` object. If omitted + no properties are supported. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class ClientSignatureInformationOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + documentation_format: Optional[Sequence[MarkupKind]] = attrs.field(default=None) + """Client supports the following content formats for the documentation + property. The order describes the preferred format of the client.""" + + parameter_information: Optional[ + "ClientSignatureParameterInformationOptions" + ] = attrs.field(default=None) + """Client capabilities specific to parameter information.""" + + active_parameter_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports the `activeParameter` property on `SignatureInformation` + literal. + + @since 3.16.0""" + # Since: 3.16.0 + + +@attrs.define +class ClientCodeActionLiteralOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + code_action_kind: "ClientCodeActionKindOptions" = attrs.field() + """The code action kind is support with the following value + set.""" + + +@attrs.define +class ClientCodeActionResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: Sequence[str] = attrs.field() + """The properties that a client can resolve lazily.""" + + +@attrs.define +class ClientFoldingRangeKindOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Optional[Sequence[Union[FoldingRangeKind, str]]] = attrs.field( + default=None + ) + """The folding range kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown.""" + + +@attrs.define +class ClientFoldingRangeOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + collapsed_text: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """If set, the client signals that it supports setting collapsedText on + folding ranges to display custom labels instead of the default text. + + @since 3.17.0""" + # Since: 3.17.0 + + +@attrs.define +class ClientDiagnosticsTagOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Sequence[DiagnosticTag] = attrs.field() + """The tags supported by the client.""" + + +@attrs.define +class ClientSemanticTokensRequestOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + range: Optional[Union[bool, Any]] = attrs.field(default=None) + """The client will send the `textDocument/semanticTokens/range` request if + the server provides a corresponding handler.""" + + full: Optional[Union[bool, "ClientSemanticTokensRequestFullDelta"]] = attrs.field( + default=None + ) + """The client will send the `textDocument/semanticTokens/full` request if + the server provides a corresponding handler.""" + + +@attrs.define +class ClientInlayHintResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: Sequence[str] = attrs.field() + """The properties that a client can resolve lazily.""" + + +@attrs.define +class ClientShowMessageActionItemOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + additional_properties_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """Whether the client supports additional attributes which + are preserved and send back to the server in the + request's response.""" + + +@attrs.define +class CompletionItemTagOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Sequence[CompletionItemTag] = attrs.field() + """The tags supported by the client.""" + + +@attrs.define +class ClientCompletionItemResolveOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + properties: Sequence[str] = attrs.field() + """The properties that a client can resolve lazily.""" + + +@attrs.define +class ClientCompletionItemInsertTextModeOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Sequence[InsertTextMode] = attrs.field() + + +@attrs.define +class ClientSignatureParameterInformationOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + label_offset_support: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client supports processing label offsets instead of a + simple label string. + + @since 3.14.0""" + # Since: 3.14.0 + + +@attrs.define +class ClientCodeActionKindOptions: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + value_set: Sequence[Union[CodeActionKind, str]] = attrs.field() + """The code action kind values the client supports. When this + property exists the client also guarantees that it will + handle values outside its set gracefully and falls back + to a default value when unknown.""" + + +@attrs.define +class ClientSemanticTokensRequestFullDelta: + """@since 3.18.0 + @proposed""" + + # Since: 3.18.0 + # Proposed + + delta: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + """The client will send the `textDocument/semanticTokens/full/delta` request if + the server provides a corresponding handler.""" + + +@attrs.define +class TextDocumentColorPresentationOptions: + work_done_progress: Optional[bool] = attrs.field( + validator=attrs.validators.optional(attrs.validators.instance_of(bool)), + default=None, + ) + + document_selector: Optional[Union[DocumentSelector, None]] = attrs.field( + default=None + ) + """A document selector to identify the scope of the registration. If set to null + the document selector provided on the client side will be used.""" + + +@attrs.define +class ResponseError: + code: int = attrs.field(validator=validators.integer_validator) + """A number indicating the error type that occurred.""" + message: str = attrs.field(validator=attrs.validators.instance_of(str)) + """A string providing a short description of the error.""" + data: Optional[LSPAny] = attrs.field(default=None) + """A primitive or structured value that contains additional information + about the error. Can be omitted.""" + + +@attrs.define +class ResponseErrorMessage: + id: Optional[Union[int, str]] = attrs.field(default=None) + """The request id where the error occurred.""" + error: Optional[ResponseError] = attrs.field(default=None) + """The error object in case a request fails.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentImplementationRequest: + """A request to resolve the implementation locations of a symbol at a given text + document position. The request's parameter is of type {@link TextDocumentPositionParams} + the response is of type {@link Definition} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: ImplementationParams = attrs.field() + method: str = "textDocument/implementation" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentImplementationResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Definition, Sequence[DefinitionLink], None] = attrs.field( + default=None + ) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentTypeDefinitionRequest: + """A request to resolve the type definition locations of a symbol at a given text + document position. The request's parameter is of type {@link TextDocumentPositionParams} + the response is of type {@link Definition} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: TypeDefinitionParams = attrs.field() + method: str = "textDocument/typeDefinition" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentTypeDefinitionResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Definition, Sequence[DefinitionLink], None] = attrs.field( + default=None + ) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWorkspaceFoldersRequest: + """The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "workspace/workspaceFolders" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWorkspaceFoldersResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[WorkspaceFolder], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +WorkspaceConfigurationParams = ConfigurationParams + + +@attrs.define +class WorkspaceConfigurationRequest: + """The 'workspace/configuration' request is sent from the server to the client to fetch a certain + configuration setting. + + This pull model replaces the old push model were the client signaled configuration change via an + event. If the server still needs to react to configuration changes (since the server caches the + result of `workspace/configuration` requests) the server should register for an empty configuration + change event and empty the cache if such an event is received.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: WorkspaceConfigurationParams = attrs.field() + method: str = "workspace/configuration" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceConfigurationResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Sequence[LSPAny] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentColorRequest: + """A request to list all color symbols found in a given text document. The request's + parameter is of type {@link DocumentColorParams} the + response is of type {@link ColorInformation ColorInformation[]} or a Thenable + that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentColorParams = attrs.field() + method: str = "textDocument/documentColor" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentColorResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Sequence[ColorInformation] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentColorPresentationRequest: + """A request to list all presentation for a color. The request's + parameter is of type {@link ColorPresentationParams} the + response is of type {@link ColorInformation ColorInformation[]} or a Thenable + that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: ColorPresentationParams = attrs.field() + method: str = "textDocument/colorPresentation" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentColorPresentationResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Sequence[ColorPresentation] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentFoldingRangeRequest: + """A request to provide folding ranges in a document. The request's + parameter is of type {@link FoldingRangeParams}, the + response is of type {@link FoldingRangeList} or a Thenable + that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: FoldingRangeParams = attrs.field() + method: str = "textDocument/foldingRange" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentFoldingRangeResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[FoldingRange], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceFoldingRangeRefreshRequest: + """@since 3.18.0 + @proposed""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "workspace/foldingRange/refresh" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceFoldingRangeRefreshResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDeclarationRequest: + """A request to resolve the type definition locations of a symbol at a given text + document position. The request's parameter is of type {@link TextDocumentPositionParams} + the response is of type {@link Declaration} or a typed array of {@link DeclarationLink} + or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DeclarationParams = attrs.field() + method: str = "textDocument/declaration" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDeclarationResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Declaration, Sequence[DeclarationLink], None] = attrs.field( + default=None + ) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSelectionRangeRequest: + """A request to provide selection ranges in a document. The request's + parameter is of type {@link SelectionRangeParams}, the + response is of type {@link SelectionRange SelectionRange[]} or a Thenable + that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: SelectionRangeParams = attrs.field() + method: str = "textDocument/selectionRange" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSelectionRangeResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[SelectionRange], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowWorkDoneProgressCreateRequest: + """The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress + reporting from the server.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: WorkDoneProgressCreateParams = attrs.field() + method: str = "window/workDoneProgress/create" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowWorkDoneProgressCreateResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentPrepareCallHierarchyRequest: + """A request to result a `CallHierarchyItem` in a document at a given position. + Can be used as an input to an incoming or outgoing call hierarchy. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CallHierarchyPrepareParams = attrs.field() + method: str = "textDocument/prepareCallHierarchy" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentPrepareCallHierarchyResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[CallHierarchyItem], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CallHierarchyIncomingCallsRequest: + """A request to resolve the incoming calls for a given `CallHierarchyItem`. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CallHierarchyIncomingCallsParams = attrs.field() + method: str = "callHierarchy/incomingCalls" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CallHierarchyIncomingCallsResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[CallHierarchyIncomingCall], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CallHierarchyOutgoingCallsRequest: + """A request to resolve the outgoing calls for a given `CallHierarchyItem`. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CallHierarchyOutgoingCallsParams = attrs.field() + method: str = "callHierarchy/outgoingCalls" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CallHierarchyOutgoingCallsResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[CallHierarchyOutgoingCall], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSemanticTokensFullRequest: + """@since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: SemanticTokensParams = attrs.field() + method: str = "textDocument/semanticTokens/full" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSemanticTokensFullResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[SemanticTokens, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSemanticTokensFullDeltaRequest: + """@since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: SemanticTokensDeltaParams = attrs.field() + method: str = "textDocument/semanticTokens/full/delta" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSemanticTokensFullDeltaResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[SemanticTokens, SemanticTokensDelta, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSemanticTokensRangeRequest: + """@since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: SemanticTokensRangeParams = attrs.field() + method: str = "textDocument/semanticTokens/range" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSemanticTokensRangeResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[SemanticTokens, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceSemanticTokensRefreshRequest: + """@since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "workspace/semanticTokens/refresh" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceSemanticTokensRefreshResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowShowDocumentRequest: + """A request to show a document. This request might open an + external program depending on the value of the URI to open. + For example a request to open `https://code.visualstudio.com/` + will very likely open the URI in a WEB browser. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: ShowDocumentParams = attrs.field() + method: str = "window/showDocument" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowShowDocumentResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: ShowDocumentResult = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentLinkedEditingRangeRequest: + """A request to provide ranges that can be edited together. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: LinkedEditingRangeParams = attrs.field() + method: str = "textDocument/linkedEditingRange" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentLinkedEditingRangeResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[LinkedEditingRanges, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWillCreateFilesRequest: + """The will create files request is sent from the client to the server before files are actually + created as long as the creation is triggered from within the client. + + The request can return a `WorkspaceEdit` which will be applied to workspace before the + files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file + to be created. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CreateFilesParams = attrs.field() + method: str = "workspace/willCreateFiles" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWillCreateFilesResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[WorkspaceEdit, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWillRenameFilesRequest: + """The will rename files request is sent from the client to the server before files are actually + renamed as long as the rename is triggered from within the client. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: RenameFilesParams = attrs.field() + method: str = "workspace/willRenameFiles" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWillRenameFilesResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[WorkspaceEdit, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWillDeleteFilesRequest: + """The did delete files notification is sent from the client to the server when + files were deleted from within the client. + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DeleteFilesParams = attrs.field() + method: str = "workspace/willDeleteFiles" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceWillDeleteFilesResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[WorkspaceEdit, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentMonikerRequest: + """A request to get the moniker of a symbol at a given text document position. + The request parameter is of type {@link TextDocumentPositionParams}. + The response is of type {@link Moniker Moniker[]} or `null`.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: MonikerParams = attrs.field() + method: str = "textDocument/moniker" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentMonikerResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[Moniker], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentPrepareTypeHierarchyRequest: + """A request to result a `TypeHierarchyItem` in a document at a given position. + Can be used as an input to a subtypes or supertypes type hierarchy. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: TypeHierarchyPrepareParams = attrs.field() + method: str = "textDocument/prepareTypeHierarchy" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentPrepareTypeHierarchyResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TypeHierarchyItem], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TypeHierarchySupertypesRequest: + """A request to resolve the supertypes for a given `TypeHierarchyItem`. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: TypeHierarchySupertypesParams = attrs.field() + method: str = "typeHierarchy/supertypes" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TypeHierarchySupertypesResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TypeHierarchyItem], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TypeHierarchySubtypesRequest: + """A request to resolve the subtypes for a given `TypeHierarchyItem`. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: TypeHierarchySubtypesParams = attrs.field() + method: str = "typeHierarchy/subtypes" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TypeHierarchySubtypesResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TypeHierarchyItem], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentInlineValueRequest: + """A request to provide inline values in a document. The request's parameter is of + type {@link InlineValueParams}, the response is of type + {@link InlineValue InlineValue[]} or a Thenable that resolves to such. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: InlineValueParams = attrs.field() + method: str = "textDocument/inlineValue" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentInlineValueResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[InlineValue], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceInlineValueRefreshRequest: + """@since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "workspace/inlineValue/refresh" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceInlineValueRefreshResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentInlayHintRequest: + """A request to provide inlay hints in a document. The request's parameter is of + type {@link InlayHintsParams}, the response is of type + {@link InlayHint InlayHint[]} or a Thenable that resolves to such. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: InlayHintParams = attrs.field() + method: str = "textDocument/inlayHint" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentInlayHintResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[InlayHint], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class InlayHintResolveRequest: + """A request to resolve additional properties for an inlay hint. + The request's parameter is of type {@link InlayHint}, the response is + of type {@link InlayHint} or a Thenable that resolves to such. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: InlayHint = attrs.field() + method: str = "inlayHint/resolve" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class InlayHintResolveResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: InlayHint = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceInlayHintRefreshRequest: + """@since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "workspace/inlayHint/refresh" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceInlayHintRefreshResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDiagnosticRequest: + """The document diagnostic request definition. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentDiagnosticParams = attrs.field() + method: str = "textDocument/diagnostic" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDiagnosticResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: DocumentDiagnosticReport = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDiagnosticRequest: + """The workspace diagnostic request definition. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: WorkspaceDiagnosticParams = attrs.field() + method: str = "workspace/diagnostic" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDiagnosticResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: WorkspaceDiagnosticReport = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDiagnosticRefreshRequest: + """The diagnostic refresh request definition. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "workspace/diagnostic/refresh" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDiagnosticRefreshResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentInlineCompletionRequest: + """A request to provide inline completions in a document. The request's parameter is of + type {@link InlineCompletionParams}, the response is of type + {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such. + + @since 3.18.0 + @proposed""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: InlineCompletionParams = attrs.field() + method: str = "textDocument/inlineCompletion" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentInlineCompletionResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[ + InlineCompletionList, Sequence[InlineCompletionItem], None + ] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ClientRegisterCapabilityRequest: + """The `client/registerCapability` request is sent from the server to the client to register a new capability + handler on the client side.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: RegistrationParams = attrs.field() + method: str = "client/registerCapability" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ClientRegisterCapabilityResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ClientUnregisterCapabilityRequest: + """The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability + handler on the client side.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: UnregistrationParams = attrs.field() + method: str = "client/unregisterCapability" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ClientUnregisterCapabilityResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class InitializeRequest: + """The initialize request is sent from the client to the server. + It is sent once as the request after starting up the server. + The requests parameter is of type {@link InitializeParams} + the response if of type {@link InitializeResult} of a Thenable that + resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: InitializeParams = attrs.field() + method: str = "initialize" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class InitializeResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: InitializeResult = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ShutdownRequest: + """A shutdown request is sent from the client to the server. + It is sent once when the client decides to shutdown the + server. The only notification that is sent after a shutdown request + is the exit event.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "shutdown" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ShutdownResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowShowMessageRequestRequest: + """The show message request is sent from the server to the client to show a message + and a set of options actions to the user.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: ShowMessageRequestParams = attrs.field() + method: str = "window/showMessageRequest" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowShowMessageRequestResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[MessageActionItem, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentWillSaveWaitUntilRequest: + """A document will save request is sent from the client to the server before + the document is actually saved. The request can return an array of TextEdits + which will be applied to the text document before it is saved. Please note that + clients might drop results if computing the text edits took too long or if a + server constantly fails on this request. This is done to keep the save fast and + reliable.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: WillSaveTextDocumentParams = attrs.field() + method: str = "textDocument/willSaveWaitUntil" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentWillSaveWaitUntilResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TextEdit], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentCompletionRequest: + """Request to request completion at a given text document position. The request's + parameter is of type {@link TextDocumentPosition} the response + is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList} + or a Thenable that resolves to such. + + The request can delay the computation of the {@link CompletionItem.detail `detail`} + and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve` + request. However, properties that are needed for the initial sorting and filtering, like `sortText`, + `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CompletionParams = attrs.field() + method: str = "textDocument/completion" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentCompletionResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[CompletionItem], CompletionList, None] = attrs.field( + default=None + ) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CompletionItemResolveRequest: + """Request to resolve additional information for a given completion item.The request's + parameter is of type {@link CompletionItem} the response + is of type {@link CompletionItem} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CompletionItem = attrs.field() + method: str = "completionItem/resolve" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CompletionItemResolveResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: CompletionItem = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentHoverRequest: + """Request to request hover information at a given text document position. The request's + parameter is of type {@link TextDocumentPosition} the response is of + type {@link Hover} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: HoverParams = attrs.field() + method: str = "textDocument/hover" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentHoverResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Hover, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSignatureHelpRequest: + id: Union[int, str] = attrs.field() + """The request id.""" + params: SignatureHelpParams = attrs.field() + method: str = "textDocument/signatureHelp" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentSignatureHelpResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[SignatureHelp, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDefinitionRequest: + """A request to resolve the definition location of a symbol at a given text + document position. The request's parameter is of type {@link TextDocumentPosition} + the response is of either type {@link Definition} or a typed array of + {@link DefinitionLink} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DefinitionParams = attrs.field() + method: str = "textDocument/definition" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDefinitionResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Definition, Sequence[DefinitionLink], None] = attrs.field( + default=None + ) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentReferencesRequest: + """A request to resolve project-wide references for the symbol denoted + by the given text document position. The request's parameter is of + type {@link ReferenceParams} the response is of type + {@link Location Location[]} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: ReferenceParams = attrs.field() + method: str = "textDocument/references" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentReferencesResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[Location], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentHighlightRequest: + """Request to resolve a {@link DocumentHighlight} for a given + text document position. The request's parameter is of type {@link TextDocumentPosition} + the request response is an array of type {@link DocumentHighlight} + or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentHighlightParams = attrs.field() + method: str = "textDocument/documentHighlight" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentHighlightResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[DocumentHighlight], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentSymbolRequest: + """A request to list all symbols found in a given text document. The request's + parameter is of type {@link TextDocumentIdentifier} the + response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable + that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentSymbolParams = attrs.field() + method: str = "textDocument/documentSymbol" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentSymbolResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[ + Sequence[SymbolInformation], Sequence[DocumentSymbol], None + ] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentCodeActionRequest: + """A request to provide commands for the given text document and range.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CodeActionParams = attrs.field() + method: str = "textDocument/codeAction" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentCodeActionResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[Union[Command, CodeAction]], None] = attrs.field( + default=None + ) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CodeActionResolveRequest: + """Request to resolve additional information for a given code action.The request's + parameter is of type {@link CodeAction} the response + is of type {@link CodeAction} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CodeAction = attrs.field() + method: str = "codeAction/resolve" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CodeActionResolveResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: CodeAction = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceSymbolRequest: + """A request to list project-wide symbols matching the query string given + by the {@link WorkspaceSymbolParams}. The response is + of type {@link SymbolInformation SymbolInformation[]} or a Thenable that + resolves to such. + + @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients + need to advertise support for WorkspaceSymbols via the client capability + `workspace.symbol.resolveSupport`.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: WorkspaceSymbolParams = attrs.field() + method: str = "workspace/symbol" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceSymbolResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[ + Sequence[SymbolInformation], Sequence[WorkspaceSymbol], None + ] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceSymbolResolveRequest: + """A request to resolve the range inside the workspace + symbol's location. + + @since 3.17.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: WorkspaceSymbol = attrs.field() + method: str = "workspaceSymbol/resolve" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceSymbolResolveResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: WorkspaceSymbol = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentCodeLensRequest: + """A request to provide code lens for the given text document.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CodeLensParams = attrs.field() + method: str = "textDocument/codeLens" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentCodeLensResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[CodeLens], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CodeLensResolveRequest: + """A request to resolve a command for a given code lens.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: CodeLens = attrs.field() + method: str = "codeLens/resolve" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CodeLensResolveResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: CodeLens = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceCodeLensRefreshRequest: + """A request to refresh all code actions + + @since 3.16.0""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: Optional[None] = attrs.field(default=None) + method: str = "workspace/codeLens/refresh" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceCodeLensRefreshResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: None = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentLinkRequest: + """A request to provide document links""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentLinkParams = attrs.field() + method: str = "textDocument/documentLink" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDocumentLinkResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[DocumentLink], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class DocumentLinkResolveRequest: + """Request to resolve additional information for a given document link. The request's + parameter is of type {@link DocumentLink} the response + is of type {@link DocumentLink} or a Thenable that resolves to such.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentLink = attrs.field() + method: str = "documentLink/resolve" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class DocumentLinkResolveResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: DocumentLink = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentFormattingRequest: + """A request to format a whole document.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentFormattingParams = attrs.field() + method: str = "textDocument/formatting" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentFormattingResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TextEdit], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentRangeFormattingRequest: + """A request to format a range in a document.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentRangeFormattingParams = attrs.field() + method: str = "textDocument/rangeFormatting" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentRangeFormattingResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TextEdit], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentRangesFormattingRequest: + """A request to format ranges in a document. + + @since 3.18.0 + @proposed""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentRangesFormattingParams = attrs.field() + method: str = "textDocument/rangesFormatting" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentRangesFormattingResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TextEdit], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentOnTypeFormattingRequest: + """A request to format a document on type.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: DocumentOnTypeFormattingParams = attrs.field() + method: str = "textDocument/onTypeFormatting" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentOnTypeFormattingResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[Sequence[TextEdit], None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentRenameRequest: + """A request to rename a symbol.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: RenameParams = attrs.field() + method: str = "textDocument/rename" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentRenameResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[WorkspaceEdit, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentPrepareRenameRequest: + """A request to test and perform the setup necessary for a rename. + + @since 3.16 - support for default behavior""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: PrepareRenameParams = attrs.field() + method: str = "textDocument/prepareRename" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentPrepareRenameResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[PrepareRenameResult, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceExecuteCommandRequest: + """A request send from the client to the server to execute a command. The request might return + a workspace edit which the client will apply to the workspace.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: ExecuteCommandParams = attrs.field() + method: str = "workspace/executeCommand" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceExecuteCommandResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: Union[LSPAny, None] = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceApplyEditRequest: + """A request sent from the server to the client to modified certain resources.""" + + id: Union[int, str] = attrs.field() + """The request id.""" + params: ApplyWorkspaceEditParams = attrs.field() + method: str = "workspace/applyEdit" + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceApplyEditResponse: + id: Optional[Union[int, str]] = attrs.field() + """The request id.""" + result: ApplyWorkspaceEditResult = attrs.field(default=None) + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDidChangeWorkspaceFoldersNotification: + """The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace + folder configuration changes.""" + + params: DidChangeWorkspaceFoldersParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["workspace/didChangeWorkspaceFolders"]), + default="workspace/didChangeWorkspaceFolders", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowWorkDoneProgressCancelNotification: + """The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress + initiated on the server side.""" + + params: WorkDoneProgressCancelParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["window/workDoneProgress/cancel"]), + default="window/workDoneProgress/cancel", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDidCreateFilesNotification: + """The did create files notification is sent from the client to the server when + files were created from within the client. + + @since 3.16.0""" + + params: CreateFilesParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["workspace/didCreateFiles"]), + default="workspace/didCreateFiles", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDidRenameFilesNotification: + """The did rename files notification is sent from the client to the server when + files were renamed from within the client. + + @since 3.16.0""" + + params: RenameFilesParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["workspace/didRenameFiles"]), + default="workspace/didRenameFiles", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDidDeleteFilesNotification: + """The will delete files request is sent from the client to the server before files are actually + deleted as long as the deletion is triggered from within the client. + + @since 3.16.0""" + + params: DeleteFilesParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["workspace/didDeleteFiles"]), + default="workspace/didDeleteFiles", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class NotebookDocumentDidOpenNotification: + """A notification sent when a notebook opens. + + @since 3.17.0""" + + params: DidOpenNotebookDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["notebookDocument/didOpen"]), + default="notebookDocument/didOpen", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class NotebookDocumentDidChangeNotification: + params: DidChangeNotebookDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["notebookDocument/didChange"]), + default="notebookDocument/didChange", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class NotebookDocumentDidSaveNotification: + """A notification sent when a notebook document is saved. + + @since 3.17.0""" + + params: DidSaveNotebookDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["notebookDocument/didSave"]), + default="notebookDocument/didSave", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class NotebookDocumentDidCloseNotification: + """A notification sent when a notebook closes. + + @since 3.17.0""" + + params: DidCloseNotebookDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["notebookDocument/didClose"]), + default="notebookDocument/didClose", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class InitializedNotification: + """The initialized notification is sent from the client to the + server after the client is fully initialized and the server + is allowed to send requests from the server to the client.""" + + params: InitializedParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["initialized"]), + default="initialized", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ExitNotification: + """The exit event is sent from the client to the server to + ask the server to exit its process.""" + + params: Optional[None] = attrs.field(default=None) + method: str = attrs.field( + validator=attrs.validators.in_(["exit"]), + default="exit", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDidChangeConfigurationNotification: + """The configuration change notification is sent from the client to the server + when the client's configuration has changed. The notification contains + the changed configuration as defined by the language client.""" + + params: DidChangeConfigurationParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["workspace/didChangeConfiguration"]), + default="workspace/didChangeConfiguration", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowShowMessageNotification: + """The show message notification is sent from a server to a client to ask + the client to display a particular message in the user interface.""" + + params: ShowMessageParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["window/showMessage"]), + default="window/showMessage", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WindowLogMessageNotification: + """The log message notification is sent from the server to the client to ask + the client to log a particular message.""" + + params: LogMessageParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["window/logMessage"]), + default="window/logMessage", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TelemetryEventNotification: + """The telemetry event notification is sent from the server to the client to ask + the client to log telemetry data.""" + + params: LSPAny = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["telemetry/event"]), + default="telemetry/event", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDidOpenNotification: + """The document open notification is sent from the client to the server to signal + newly opened text documents. The document's truth is now managed by the client + and the server must not try to read the document's truth using the document's + uri. Open in this sense means it is managed by the client. It doesn't necessarily + mean that its content is presented in an editor. An open notification must not + be sent more than once without a corresponding close notification send before. + This means open and close notification must be balanced and the max open count + is one.""" + + params: DidOpenTextDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["textDocument/didOpen"]), + default="textDocument/didOpen", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDidChangeNotification: + """The document change notification is sent from the client to the server to signal + changes to a text document.""" + + params: DidChangeTextDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["textDocument/didChange"]), + default="textDocument/didChange", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDidCloseNotification: + """The document close notification is sent from the client to the server when + the document got closed in the client. The document's truth now exists where + the document's uri points to (e.g. if the document's uri is a file uri the + truth now exists on disk). As with the open notification the close notification + is about managing the document's content. Receiving a close notification + doesn't mean that the document was open in an editor before. A close + notification requires a previous open notification to be sent.""" + + params: DidCloseTextDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["textDocument/didClose"]), + default="textDocument/didClose", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentDidSaveNotification: + """The document save notification is sent from the client to the server when + the document got saved in the client.""" + + params: DidSaveTextDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["textDocument/didSave"]), + default="textDocument/didSave", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentWillSaveNotification: + """A document will save notification is sent from the client to the server before + the document is actually saved.""" + + params: WillSaveTextDocumentParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["textDocument/willSave"]), + default="textDocument/willSave", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class WorkspaceDidChangeWatchedFilesNotification: + """The watched files notification is sent from the client to the server when + the client detects changes to file watched by the language client.""" + + params: DidChangeWatchedFilesParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["workspace/didChangeWatchedFiles"]), + default="workspace/didChangeWatchedFiles", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class TextDocumentPublishDiagnosticsNotification: + """Diagnostics notification are sent from the server to the client to signal + results of validation runs.""" + + params: PublishDiagnosticsParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["textDocument/publishDiagnostics"]), + default="textDocument/publishDiagnostics", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class SetTraceNotification: + params: SetTraceParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["$/setTrace"]), + default="$/setTrace", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class LogTraceNotification: + params: LogTraceParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["$/logTrace"]), + default="$/logTrace", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class CancelRequestNotification: + params: CancelParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["$/cancelRequest"]), + default="$/cancelRequest", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@attrs.define +class ProgressNotification: + params: ProgressParams = attrs.field() + method: str = attrs.field( + validator=attrs.validators.in_(["$/progress"]), + default="$/progress", + ) + """The method to be invoked.""" + jsonrpc: str = attrs.field(default="2.0") + + +@enum.unique +class MessageDirection(enum.Enum): + Both = "both" + ClientToServer = "clientToServer" + ServerToClient = "serverToClient" + + +CALL_HIERARCHY_INCOMING_CALLS = "callHierarchy/incomingCalls" +CALL_HIERARCHY_OUTGOING_CALLS = "callHierarchy/outgoingCalls" +CANCEL_REQUEST = "$/cancelRequest" +CLIENT_REGISTER_CAPABILITY = "client/registerCapability" +CLIENT_UNREGISTER_CAPABILITY = "client/unregisterCapability" +CODE_ACTION_RESOLVE = "codeAction/resolve" +CODE_LENS_RESOLVE = "codeLens/resolve" +COMPLETION_ITEM_RESOLVE = "completionItem/resolve" +DOCUMENT_LINK_RESOLVE = "documentLink/resolve" +EXIT = "exit" +INITIALIZE = "initialize" +INITIALIZED = "initialized" +INLAY_HINT_RESOLVE = "inlayHint/resolve" +LOG_TRACE = "$/logTrace" +NOTEBOOK_DOCUMENT_DID_CHANGE = "notebookDocument/didChange" +NOTEBOOK_DOCUMENT_DID_CLOSE = "notebookDocument/didClose" +NOTEBOOK_DOCUMENT_DID_OPEN = "notebookDocument/didOpen" +NOTEBOOK_DOCUMENT_DID_SAVE = "notebookDocument/didSave" +PROGRESS = "$/progress" +SET_TRACE = "$/setTrace" +SHUTDOWN = "shutdown" +TELEMETRY_EVENT = "telemetry/event" +TEXT_DOCUMENT_CODE_ACTION = "textDocument/codeAction" +TEXT_DOCUMENT_CODE_LENS = "textDocument/codeLens" +TEXT_DOCUMENT_COLOR_PRESENTATION = "textDocument/colorPresentation" +TEXT_DOCUMENT_COMPLETION = "textDocument/completion" +TEXT_DOCUMENT_DECLARATION = "textDocument/declaration" +TEXT_DOCUMENT_DEFINITION = "textDocument/definition" +TEXT_DOCUMENT_DIAGNOSTIC = "textDocument/diagnostic" +TEXT_DOCUMENT_DID_CHANGE = "textDocument/didChange" +TEXT_DOCUMENT_DID_CLOSE = "textDocument/didClose" +TEXT_DOCUMENT_DID_OPEN = "textDocument/didOpen" +TEXT_DOCUMENT_DID_SAVE = "textDocument/didSave" +TEXT_DOCUMENT_DOCUMENT_COLOR = "textDocument/documentColor" +TEXT_DOCUMENT_DOCUMENT_HIGHLIGHT = "textDocument/documentHighlight" +TEXT_DOCUMENT_DOCUMENT_LINK = "textDocument/documentLink" +TEXT_DOCUMENT_DOCUMENT_SYMBOL = "textDocument/documentSymbol" +TEXT_DOCUMENT_FOLDING_RANGE = "textDocument/foldingRange" +TEXT_DOCUMENT_FORMATTING = "textDocument/formatting" +TEXT_DOCUMENT_HOVER = "textDocument/hover" +TEXT_DOCUMENT_IMPLEMENTATION = "textDocument/implementation" +TEXT_DOCUMENT_INLAY_HINT = "textDocument/inlayHint" +TEXT_DOCUMENT_INLINE_COMPLETION = "textDocument/inlineCompletion" +TEXT_DOCUMENT_INLINE_VALUE = "textDocument/inlineValue" +TEXT_DOCUMENT_LINKED_EDITING_RANGE = "textDocument/linkedEditingRange" +TEXT_DOCUMENT_MONIKER = "textDocument/moniker" +TEXT_DOCUMENT_ON_TYPE_FORMATTING = "textDocument/onTypeFormatting" +TEXT_DOCUMENT_PREPARE_CALL_HIERARCHY = "textDocument/prepareCallHierarchy" +TEXT_DOCUMENT_PREPARE_RENAME = "textDocument/prepareRename" +TEXT_DOCUMENT_PREPARE_TYPE_HIERARCHY = "textDocument/prepareTypeHierarchy" +TEXT_DOCUMENT_PUBLISH_DIAGNOSTICS = "textDocument/publishDiagnostics" +TEXT_DOCUMENT_RANGES_FORMATTING = "textDocument/rangesFormatting" +TEXT_DOCUMENT_RANGE_FORMATTING = "textDocument/rangeFormatting" +TEXT_DOCUMENT_REFERENCES = "textDocument/references" +TEXT_DOCUMENT_RENAME = "textDocument/rename" +TEXT_DOCUMENT_SELECTION_RANGE = "textDocument/selectionRange" +TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL = "textDocument/semanticTokens/full" +TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL_DELTA = "textDocument/semanticTokens/full/delta" +TEXT_DOCUMENT_SEMANTIC_TOKENS_RANGE = "textDocument/semanticTokens/range" +TEXT_DOCUMENT_SIGNATURE_HELP = "textDocument/signatureHelp" +TEXT_DOCUMENT_TYPE_DEFINITION = "textDocument/typeDefinition" +TEXT_DOCUMENT_WILL_SAVE = "textDocument/willSave" +TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL = "textDocument/willSaveWaitUntil" +TYPE_HIERARCHY_SUBTYPES = "typeHierarchy/subtypes" +TYPE_HIERARCHY_SUPERTYPES = "typeHierarchy/supertypes" +WINDOW_LOG_MESSAGE = "window/logMessage" +WINDOW_SHOW_DOCUMENT = "window/showDocument" +WINDOW_SHOW_MESSAGE = "window/showMessage" +WINDOW_SHOW_MESSAGE_REQUEST = "window/showMessageRequest" +WINDOW_WORK_DONE_PROGRESS_CANCEL = "window/workDoneProgress/cancel" +WINDOW_WORK_DONE_PROGRESS_CREATE = "window/workDoneProgress/create" +WORKSPACE_APPLY_EDIT = "workspace/applyEdit" +WORKSPACE_CODE_LENS_REFRESH = "workspace/codeLens/refresh" +WORKSPACE_CONFIGURATION = "workspace/configuration" +WORKSPACE_DIAGNOSTIC = "workspace/diagnostic" +WORKSPACE_DIAGNOSTIC_REFRESH = "workspace/diagnostic/refresh" +WORKSPACE_DID_CHANGE_CONFIGURATION = "workspace/didChangeConfiguration" +WORKSPACE_DID_CHANGE_WATCHED_FILES = "workspace/didChangeWatchedFiles" +WORKSPACE_DID_CHANGE_WORKSPACE_FOLDERS = "workspace/didChangeWorkspaceFolders" +WORKSPACE_DID_CREATE_FILES = "workspace/didCreateFiles" +WORKSPACE_DID_DELETE_FILES = "workspace/didDeleteFiles" +WORKSPACE_DID_RENAME_FILES = "workspace/didRenameFiles" +WORKSPACE_EXECUTE_COMMAND = "workspace/executeCommand" +WORKSPACE_FOLDING_RANGE_REFRESH = "workspace/foldingRange/refresh" +WORKSPACE_INLAY_HINT_REFRESH = "workspace/inlayHint/refresh" +WORKSPACE_INLINE_VALUE_REFRESH = "workspace/inlineValue/refresh" +WORKSPACE_SEMANTIC_TOKENS_REFRESH = "workspace/semanticTokens/refresh" +WORKSPACE_SYMBOL = "workspace/symbol" +WORKSPACE_SYMBOL_RESOLVE = "workspaceSymbol/resolve" +WORKSPACE_WILL_CREATE_FILES = "workspace/willCreateFiles" +WORKSPACE_WILL_DELETE_FILES = "workspace/willDeleteFiles" +WORKSPACE_WILL_RENAME_FILES = "workspace/willRenameFiles" +WORKSPACE_WORKSPACE_FOLDERS = "workspace/workspaceFolders" + +METHOD_TO_TYPES = { + # Requests + CALL_HIERARCHY_INCOMING_CALLS: ( + CallHierarchyIncomingCallsRequest, + CallHierarchyIncomingCallsResponse, + CallHierarchyIncomingCallsParams, + None, + ), + CALL_HIERARCHY_OUTGOING_CALLS: ( + CallHierarchyOutgoingCallsRequest, + CallHierarchyOutgoingCallsResponse, + CallHierarchyOutgoingCallsParams, + None, + ), + CLIENT_REGISTER_CAPABILITY: ( + ClientRegisterCapabilityRequest, + ClientRegisterCapabilityResponse, + RegistrationParams, + None, + ), + CLIENT_UNREGISTER_CAPABILITY: ( + ClientUnregisterCapabilityRequest, + ClientUnregisterCapabilityResponse, + UnregistrationParams, + None, + ), + CODE_ACTION_RESOLVE: ( + CodeActionResolveRequest, + CodeActionResolveResponse, + CodeAction, + None, + ), + CODE_LENS_RESOLVE: ( + CodeLensResolveRequest, + CodeLensResolveResponse, + CodeLens, + None, + ), + COMPLETION_ITEM_RESOLVE: ( + CompletionItemResolveRequest, + CompletionItemResolveResponse, + CompletionItem, + None, + ), + DOCUMENT_LINK_RESOLVE: ( + DocumentLinkResolveRequest, + DocumentLinkResolveResponse, + DocumentLink, + None, + ), + INITIALIZE: (InitializeRequest, InitializeResponse, InitializeParams, None), + INLAY_HINT_RESOLVE: ( + InlayHintResolveRequest, + InlayHintResolveResponse, + InlayHint, + None, + ), + SHUTDOWN: (ShutdownRequest, ShutdownResponse, None, None), + TEXT_DOCUMENT_CODE_ACTION: ( + TextDocumentCodeActionRequest, + TextDocumentCodeActionResponse, + CodeActionParams, + CodeActionRegistrationOptions, + ), + TEXT_DOCUMENT_CODE_LENS: ( + TextDocumentCodeLensRequest, + TextDocumentCodeLensResponse, + CodeLensParams, + CodeLensRegistrationOptions, + ), + TEXT_DOCUMENT_COLOR_PRESENTATION: ( + TextDocumentColorPresentationRequest, + TextDocumentColorPresentationResponse, + ColorPresentationParams, + TextDocumentColorPresentationOptions, + ), + TEXT_DOCUMENT_COMPLETION: ( + TextDocumentCompletionRequest, + TextDocumentCompletionResponse, + CompletionParams, + CompletionRegistrationOptions, + ), + TEXT_DOCUMENT_DECLARATION: ( + TextDocumentDeclarationRequest, + TextDocumentDeclarationResponse, + DeclarationParams, + DeclarationRegistrationOptions, + ), + TEXT_DOCUMENT_DEFINITION: ( + TextDocumentDefinitionRequest, + TextDocumentDefinitionResponse, + DefinitionParams, + DefinitionRegistrationOptions, + ), + TEXT_DOCUMENT_DIAGNOSTIC: ( + TextDocumentDiagnosticRequest, + TextDocumentDiagnosticResponse, + DocumentDiagnosticParams, + DiagnosticRegistrationOptions, + ), + TEXT_DOCUMENT_DOCUMENT_COLOR: ( + TextDocumentDocumentColorRequest, + TextDocumentDocumentColorResponse, + DocumentColorParams, + DocumentColorRegistrationOptions, + ), + TEXT_DOCUMENT_DOCUMENT_HIGHLIGHT: ( + TextDocumentDocumentHighlightRequest, + TextDocumentDocumentHighlightResponse, + DocumentHighlightParams, + DocumentHighlightRegistrationOptions, + ), + TEXT_DOCUMENT_DOCUMENT_LINK: ( + TextDocumentDocumentLinkRequest, + TextDocumentDocumentLinkResponse, + DocumentLinkParams, + DocumentLinkRegistrationOptions, + ), + TEXT_DOCUMENT_DOCUMENT_SYMBOL: ( + TextDocumentDocumentSymbolRequest, + TextDocumentDocumentSymbolResponse, + DocumentSymbolParams, + DocumentSymbolRegistrationOptions, + ), + TEXT_DOCUMENT_FOLDING_RANGE: ( + TextDocumentFoldingRangeRequest, + TextDocumentFoldingRangeResponse, + FoldingRangeParams, + FoldingRangeRegistrationOptions, + ), + TEXT_DOCUMENT_FORMATTING: ( + TextDocumentFormattingRequest, + TextDocumentFormattingResponse, + DocumentFormattingParams, + DocumentFormattingRegistrationOptions, + ), + TEXT_DOCUMENT_HOVER: ( + TextDocumentHoverRequest, + TextDocumentHoverResponse, + HoverParams, + HoverRegistrationOptions, + ), + TEXT_DOCUMENT_IMPLEMENTATION: ( + TextDocumentImplementationRequest, + TextDocumentImplementationResponse, + ImplementationParams, + ImplementationRegistrationOptions, + ), + TEXT_DOCUMENT_INLAY_HINT: ( + TextDocumentInlayHintRequest, + TextDocumentInlayHintResponse, + InlayHintParams, + InlayHintRegistrationOptions, + ), + TEXT_DOCUMENT_INLINE_COMPLETION: ( + TextDocumentInlineCompletionRequest, + TextDocumentInlineCompletionResponse, + InlineCompletionParams, + InlineCompletionRegistrationOptions, + ), + TEXT_DOCUMENT_INLINE_VALUE: ( + TextDocumentInlineValueRequest, + TextDocumentInlineValueResponse, + InlineValueParams, + InlineValueRegistrationOptions, + ), + TEXT_DOCUMENT_LINKED_EDITING_RANGE: ( + TextDocumentLinkedEditingRangeRequest, + TextDocumentLinkedEditingRangeResponse, + LinkedEditingRangeParams, + LinkedEditingRangeRegistrationOptions, + ), + TEXT_DOCUMENT_MONIKER: ( + TextDocumentMonikerRequest, + TextDocumentMonikerResponse, + MonikerParams, + MonikerRegistrationOptions, + ), + TEXT_DOCUMENT_ON_TYPE_FORMATTING: ( + TextDocumentOnTypeFormattingRequest, + TextDocumentOnTypeFormattingResponse, + DocumentOnTypeFormattingParams, + DocumentOnTypeFormattingRegistrationOptions, + ), + TEXT_DOCUMENT_PREPARE_CALL_HIERARCHY: ( + TextDocumentPrepareCallHierarchyRequest, + TextDocumentPrepareCallHierarchyResponse, + CallHierarchyPrepareParams, + CallHierarchyRegistrationOptions, + ), + TEXT_DOCUMENT_PREPARE_RENAME: ( + TextDocumentPrepareRenameRequest, + TextDocumentPrepareRenameResponse, + PrepareRenameParams, + None, + ), + TEXT_DOCUMENT_PREPARE_TYPE_HIERARCHY: ( + TextDocumentPrepareTypeHierarchyRequest, + TextDocumentPrepareTypeHierarchyResponse, + TypeHierarchyPrepareParams, + TypeHierarchyRegistrationOptions, + ), + TEXT_DOCUMENT_RANGES_FORMATTING: ( + TextDocumentRangesFormattingRequest, + TextDocumentRangesFormattingResponse, + DocumentRangesFormattingParams, + DocumentRangeFormattingRegistrationOptions, + ), + TEXT_DOCUMENT_RANGE_FORMATTING: ( + TextDocumentRangeFormattingRequest, + TextDocumentRangeFormattingResponse, + DocumentRangeFormattingParams, + DocumentRangeFormattingRegistrationOptions, + ), + TEXT_DOCUMENT_REFERENCES: ( + TextDocumentReferencesRequest, + TextDocumentReferencesResponse, + ReferenceParams, + ReferenceRegistrationOptions, + ), + TEXT_DOCUMENT_RENAME: ( + TextDocumentRenameRequest, + TextDocumentRenameResponse, + RenameParams, + RenameRegistrationOptions, + ), + TEXT_DOCUMENT_SELECTION_RANGE: ( + TextDocumentSelectionRangeRequest, + TextDocumentSelectionRangeResponse, + SelectionRangeParams, + SelectionRangeRegistrationOptions, + ), + TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL: ( + TextDocumentSemanticTokensFullRequest, + TextDocumentSemanticTokensFullResponse, + SemanticTokensParams, + SemanticTokensRegistrationOptions, + ), + TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL_DELTA: ( + TextDocumentSemanticTokensFullDeltaRequest, + TextDocumentSemanticTokensFullDeltaResponse, + SemanticTokensDeltaParams, + SemanticTokensRegistrationOptions, + ), + TEXT_DOCUMENT_SEMANTIC_TOKENS_RANGE: ( + TextDocumentSemanticTokensRangeRequest, + TextDocumentSemanticTokensRangeResponse, + SemanticTokensRangeParams, + None, + ), + TEXT_DOCUMENT_SIGNATURE_HELP: ( + TextDocumentSignatureHelpRequest, + TextDocumentSignatureHelpResponse, + SignatureHelpParams, + SignatureHelpRegistrationOptions, + ), + TEXT_DOCUMENT_TYPE_DEFINITION: ( + TextDocumentTypeDefinitionRequest, + TextDocumentTypeDefinitionResponse, + TypeDefinitionParams, + TypeDefinitionRegistrationOptions, + ), + TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL: ( + TextDocumentWillSaveWaitUntilRequest, + TextDocumentWillSaveWaitUntilResponse, + WillSaveTextDocumentParams, + TextDocumentRegistrationOptions, + ), + TYPE_HIERARCHY_SUBTYPES: ( + TypeHierarchySubtypesRequest, + TypeHierarchySubtypesResponse, + TypeHierarchySubtypesParams, + None, + ), + TYPE_HIERARCHY_SUPERTYPES: ( + TypeHierarchySupertypesRequest, + TypeHierarchySupertypesResponse, + TypeHierarchySupertypesParams, + None, + ), + WINDOW_SHOW_DOCUMENT: ( + WindowShowDocumentRequest, + WindowShowDocumentResponse, + ShowDocumentParams, + None, + ), + WINDOW_SHOW_MESSAGE_REQUEST: ( + WindowShowMessageRequestRequest, + WindowShowMessageRequestResponse, + ShowMessageRequestParams, + None, + ), + WINDOW_WORK_DONE_PROGRESS_CREATE: ( + WindowWorkDoneProgressCreateRequest, + WindowWorkDoneProgressCreateResponse, + WorkDoneProgressCreateParams, + None, + ), + WORKSPACE_APPLY_EDIT: ( + WorkspaceApplyEditRequest, + WorkspaceApplyEditResponse, + ApplyWorkspaceEditParams, + None, + ), + WORKSPACE_CODE_LENS_REFRESH: ( + WorkspaceCodeLensRefreshRequest, + WorkspaceCodeLensRefreshResponse, + None, + None, + ), + WORKSPACE_CONFIGURATION: ( + WorkspaceConfigurationRequest, + WorkspaceConfigurationResponse, + ConfigurationParams, + None, + ), + WORKSPACE_DIAGNOSTIC: ( + WorkspaceDiagnosticRequest, + WorkspaceDiagnosticResponse, + WorkspaceDiagnosticParams, + None, + ), + WORKSPACE_DIAGNOSTIC_REFRESH: ( + WorkspaceDiagnosticRefreshRequest, + WorkspaceDiagnosticRefreshResponse, + None, + None, + ), + WORKSPACE_EXECUTE_COMMAND: ( + WorkspaceExecuteCommandRequest, + WorkspaceExecuteCommandResponse, + ExecuteCommandParams, + ExecuteCommandRegistrationOptions, + ), + WORKSPACE_FOLDING_RANGE_REFRESH: ( + WorkspaceFoldingRangeRefreshRequest, + WorkspaceFoldingRangeRefreshResponse, + None, + None, + ), + WORKSPACE_INLAY_HINT_REFRESH: ( + WorkspaceInlayHintRefreshRequest, + WorkspaceInlayHintRefreshResponse, + None, + None, + ), + WORKSPACE_INLINE_VALUE_REFRESH: ( + WorkspaceInlineValueRefreshRequest, + WorkspaceInlineValueRefreshResponse, + None, + None, + ), + WORKSPACE_SEMANTIC_TOKENS_REFRESH: ( + WorkspaceSemanticTokensRefreshRequest, + WorkspaceSemanticTokensRefreshResponse, + None, + None, + ), + WORKSPACE_SYMBOL: ( + WorkspaceSymbolRequest, + WorkspaceSymbolResponse, + WorkspaceSymbolParams, + WorkspaceSymbolRegistrationOptions, + ), + WORKSPACE_SYMBOL_RESOLVE: ( + WorkspaceSymbolResolveRequest, + WorkspaceSymbolResolveResponse, + WorkspaceSymbol, + None, + ), + WORKSPACE_WILL_CREATE_FILES: ( + WorkspaceWillCreateFilesRequest, + WorkspaceWillCreateFilesResponse, + CreateFilesParams, + FileOperationRegistrationOptions, + ), + WORKSPACE_WILL_DELETE_FILES: ( + WorkspaceWillDeleteFilesRequest, + WorkspaceWillDeleteFilesResponse, + DeleteFilesParams, + FileOperationRegistrationOptions, + ), + WORKSPACE_WILL_RENAME_FILES: ( + WorkspaceWillRenameFilesRequest, + WorkspaceWillRenameFilesResponse, + RenameFilesParams, + FileOperationRegistrationOptions, + ), + WORKSPACE_WORKSPACE_FOLDERS: ( + WorkspaceWorkspaceFoldersRequest, + WorkspaceWorkspaceFoldersResponse, + None, + None, + ), + # Notifications + CANCEL_REQUEST: (CancelRequestNotification, None, CancelParams, None), + EXIT: (ExitNotification, None, None, None), + INITIALIZED: (InitializedNotification, None, InitializedParams, None), + LOG_TRACE: (LogTraceNotification, None, LogTraceParams, None), + NOTEBOOK_DOCUMENT_DID_CHANGE: ( + NotebookDocumentDidChangeNotification, + None, + DidChangeNotebookDocumentParams, + None, + ), + NOTEBOOK_DOCUMENT_DID_CLOSE: ( + NotebookDocumentDidCloseNotification, + None, + DidCloseNotebookDocumentParams, + None, + ), + NOTEBOOK_DOCUMENT_DID_OPEN: ( + NotebookDocumentDidOpenNotification, + None, + DidOpenNotebookDocumentParams, + None, + ), + NOTEBOOK_DOCUMENT_DID_SAVE: ( + NotebookDocumentDidSaveNotification, + None, + DidSaveNotebookDocumentParams, + None, + ), + PROGRESS: (ProgressNotification, None, ProgressParams, None), + SET_TRACE: (SetTraceNotification, None, SetTraceParams, None), + TELEMETRY_EVENT: (TelemetryEventNotification, None, LSPAny, None), + TEXT_DOCUMENT_DID_CHANGE: ( + TextDocumentDidChangeNotification, + None, + DidChangeTextDocumentParams, + TextDocumentChangeRegistrationOptions, + ), + TEXT_DOCUMENT_DID_CLOSE: ( + TextDocumentDidCloseNotification, + None, + DidCloseTextDocumentParams, + TextDocumentRegistrationOptions, + ), + TEXT_DOCUMENT_DID_OPEN: ( + TextDocumentDidOpenNotification, + None, + DidOpenTextDocumentParams, + TextDocumentRegistrationOptions, + ), + TEXT_DOCUMENT_DID_SAVE: ( + TextDocumentDidSaveNotification, + None, + DidSaveTextDocumentParams, + TextDocumentSaveRegistrationOptions, + ), + TEXT_DOCUMENT_PUBLISH_DIAGNOSTICS: ( + TextDocumentPublishDiagnosticsNotification, + None, + PublishDiagnosticsParams, + None, + ), + TEXT_DOCUMENT_WILL_SAVE: ( + TextDocumentWillSaveNotification, + None, + WillSaveTextDocumentParams, + TextDocumentRegistrationOptions, + ), + WINDOW_LOG_MESSAGE: (WindowLogMessageNotification, None, LogMessageParams, None), + WINDOW_SHOW_MESSAGE: (WindowShowMessageNotification, None, ShowMessageParams, None), + WINDOW_WORK_DONE_PROGRESS_CANCEL: ( + WindowWorkDoneProgressCancelNotification, + None, + WorkDoneProgressCancelParams, + None, + ), + WORKSPACE_DID_CHANGE_CONFIGURATION: ( + WorkspaceDidChangeConfigurationNotification, + None, + DidChangeConfigurationParams, + DidChangeConfigurationRegistrationOptions, + ), + WORKSPACE_DID_CHANGE_WATCHED_FILES: ( + WorkspaceDidChangeWatchedFilesNotification, + None, + DidChangeWatchedFilesParams, + DidChangeWatchedFilesRegistrationOptions, + ), + WORKSPACE_DID_CHANGE_WORKSPACE_FOLDERS: ( + WorkspaceDidChangeWorkspaceFoldersNotification, + None, + DidChangeWorkspaceFoldersParams, + None, + ), + WORKSPACE_DID_CREATE_FILES: ( + WorkspaceDidCreateFilesNotification, + None, + CreateFilesParams, + FileOperationRegistrationOptions, + ), + WORKSPACE_DID_DELETE_FILES: ( + WorkspaceDidDeleteFilesNotification, + None, + DeleteFilesParams, + FileOperationRegistrationOptions, + ), + WORKSPACE_DID_RENAME_FILES: ( + WorkspaceDidRenameFilesNotification, + None, + RenameFilesParams, + FileOperationRegistrationOptions, + ), +} +REQUESTS = Union[ + CallHierarchyIncomingCallsRequest, + CallHierarchyOutgoingCallsRequest, + ClientRegisterCapabilityRequest, + ClientUnregisterCapabilityRequest, + CodeActionResolveRequest, + CodeLensResolveRequest, + CompletionItemResolveRequest, + DocumentLinkResolveRequest, + InitializeRequest, + InlayHintResolveRequest, + ShutdownRequest, + TextDocumentCodeActionRequest, + TextDocumentCodeLensRequest, + TextDocumentColorPresentationRequest, + TextDocumentCompletionRequest, + TextDocumentDeclarationRequest, + TextDocumentDefinitionRequest, + TextDocumentDiagnosticRequest, + TextDocumentDocumentColorRequest, + TextDocumentDocumentHighlightRequest, + TextDocumentDocumentLinkRequest, + TextDocumentDocumentSymbolRequest, + TextDocumentFoldingRangeRequest, + TextDocumentFormattingRequest, + TextDocumentHoverRequest, + TextDocumentImplementationRequest, + TextDocumentInlayHintRequest, + TextDocumentInlineCompletionRequest, + TextDocumentInlineValueRequest, + TextDocumentLinkedEditingRangeRequest, + TextDocumentMonikerRequest, + TextDocumentOnTypeFormattingRequest, + TextDocumentPrepareCallHierarchyRequest, + TextDocumentPrepareRenameRequest, + TextDocumentPrepareTypeHierarchyRequest, + TextDocumentRangeFormattingRequest, + TextDocumentRangesFormattingRequest, + TextDocumentReferencesRequest, + TextDocumentRenameRequest, + TextDocumentSelectionRangeRequest, + TextDocumentSemanticTokensFullDeltaRequest, + TextDocumentSemanticTokensFullRequest, + TextDocumentSemanticTokensRangeRequest, + TextDocumentSignatureHelpRequest, + TextDocumentTypeDefinitionRequest, + TextDocumentWillSaveWaitUntilRequest, + TypeHierarchySubtypesRequest, + TypeHierarchySupertypesRequest, + WindowShowDocumentRequest, + WindowShowMessageRequestRequest, + WindowWorkDoneProgressCreateRequest, + WorkspaceApplyEditRequest, + WorkspaceCodeLensRefreshRequest, + WorkspaceConfigurationRequest, + WorkspaceDiagnosticRefreshRequest, + WorkspaceDiagnosticRequest, + WorkspaceExecuteCommandRequest, + WorkspaceFoldingRangeRefreshRequest, + WorkspaceInlayHintRefreshRequest, + WorkspaceInlineValueRefreshRequest, + WorkspaceSemanticTokensRefreshRequest, + WorkspaceSymbolRequest, + WorkspaceSymbolResolveRequest, + WorkspaceWillCreateFilesRequest, + WorkspaceWillDeleteFilesRequest, + WorkspaceWillRenameFilesRequest, + WorkspaceWorkspaceFoldersRequest, +] +RESPONSES = Union[ + CallHierarchyIncomingCallsResponse, + CallHierarchyOutgoingCallsResponse, + ClientRegisterCapabilityResponse, + ClientUnregisterCapabilityResponse, + CodeActionResolveResponse, + CodeLensResolveResponse, + CompletionItemResolveResponse, + DocumentLinkResolveResponse, + InitializeResponse, + InlayHintResolveResponse, + ShutdownResponse, + TextDocumentCodeActionResponse, + TextDocumentCodeLensResponse, + TextDocumentColorPresentationResponse, + TextDocumentCompletionResponse, + TextDocumentDeclarationResponse, + TextDocumentDefinitionResponse, + TextDocumentDiagnosticResponse, + TextDocumentDocumentColorResponse, + TextDocumentDocumentHighlightResponse, + TextDocumentDocumentLinkResponse, + TextDocumentDocumentSymbolResponse, + TextDocumentFoldingRangeResponse, + TextDocumentFormattingResponse, + TextDocumentHoverResponse, + TextDocumentImplementationResponse, + TextDocumentInlayHintResponse, + TextDocumentInlineCompletionResponse, + TextDocumentInlineValueResponse, + TextDocumentLinkedEditingRangeResponse, + TextDocumentMonikerResponse, + TextDocumentOnTypeFormattingResponse, + TextDocumentPrepareCallHierarchyResponse, + TextDocumentPrepareRenameResponse, + TextDocumentPrepareTypeHierarchyResponse, + TextDocumentRangeFormattingResponse, + TextDocumentRangesFormattingResponse, + TextDocumentReferencesResponse, + TextDocumentRenameResponse, + TextDocumentSelectionRangeResponse, + TextDocumentSemanticTokensFullDeltaResponse, + TextDocumentSemanticTokensFullResponse, + TextDocumentSemanticTokensRangeResponse, + TextDocumentSignatureHelpResponse, + TextDocumentTypeDefinitionResponse, + TextDocumentWillSaveWaitUntilResponse, + TypeHierarchySubtypesResponse, + TypeHierarchySupertypesResponse, + WindowShowDocumentResponse, + WindowShowMessageRequestResponse, + WindowWorkDoneProgressCreateResponse, + WorkspaceApplyEditResponse, + WorkspaceCodeLensRefreshResponse, + WorkspaceConfigurationResponse, + WorkspaceDiagnosticRefreshResponse, + WorkspaceDiagnosticResponse, + WorkspaceExecuteCommandResponse, + WorkspaceFoldingRangeRefreshResponse, + WorkspaceInlayHintRefreshResponse, + WorkspaceInlineValueRefreshResponse, + WorkspaceSemanticTokensRefreshResponse, + WorkspaceSymbolResolveResponse, + WorkspaceSymbolResponse, + WorkspaceWillCreateFilesResponse, + WorkspaceWillDeleteFilesResponse, + WorkspaceWillRenameFilesResponse, + WorkspaceWorkspaceFoldersResponse, +] +NOTIFICATIONS = Union[ + CancelRequestNotification, + ExitNotification, + InitializedNotification, + LogTraceNotification, + NotebookDocumentDidChangeNotification, + NotebookDocumentDidCloseNotification, + NotebookDocumentDidOpenNotification, + NotebookDocumentDidSaveNotification, + ProgressNotification, + SetTraceNotification, + TelemetryEventNotification, + TextDocumentDidChangeNotification, + TextDocumentDidCloseNotification, + TextDocumentDidOpenNotification, + TextDocumentDidSaveNotification, + TextDocumentPublishDiagnosticsNotification, + TextDocumentWillSaveNotification, + WindowLogMessageNotification, + WindowShowMessageNotification, + WindowWorkDoneProgressCancelNotification, + WorkspaceDidChangeConfigurationNotification, + WorkspaceDidChangeWatchedFilesNotification, + WorkspaceDidChangeWorkspaceFoldersNotification, + WorkspaceDidCreateFilesNotification, + WorkspaceDidDeleteFilesNotification, + WorkspaceDidRenameFilesNotification, +] +MESSAGE_TYPES = Union[REQUESTS, RESPONSES, NOTIFICATIONS, ResponseErrorMessage] + +_KEYWORD_CLASSES = [CallHierarchyIncomingCall] + + +def is_keyword_class(cls: type) -> bool: + """Returns true if the class has a property that may be python keyword.""" + return any(cls is c for c in _KEYWORD_CLASSES) + + +_SPECIAL_CLASSES = [ + CallHierarchyIncomingCallsRequest, + CallHierarchyIncomingCallsResponse, + CallHierarchyOutgoingCallsRequest, + CallHierarchyOutgoingCallsResponse, + CallHierarchyRegistrationOptions, + CancelRequestNotification, + ClientRegisterCapabilityRequest, + ClientRegisterCapabilityResponse, + ClientUnregisterCapabilityRequest, + ClientUnregisterCapabilityResponse, + CodeActionRegistrationOptions, + CodeActionResolveRequest, + CodeActionResolveResponse, + CodeLensRegistrationOptions, + CodeLensResolveRequest, + CodeLensResolveResponse, + CompletionItemResolveRequest, + CompletionItemResolveResponse, + CompletionRegistrationOptions, + CreateFile, + DeclarationRegistrationOptions, + DefinitionRegistrationOptions, + DeleteFile, + DiagnosticRegistrationOptions, + DocumentColorRegistrationOptions, + DocumentFormattingRegistrationOptions, + DocumentHighlightRegistrationOptions, + DocumentLinkRegistrationOptions, + DocumentLinkResolveRequest, + DocumentLinkResolveResponse, + DocumentOnTypeFormattingRegistrationOptions, + DocumentRangeFormattingRegistrationOptions, + DocumentSymbolRegistrationOptions, + ExitNotification, + FoldingRangeRegistrationOptions, + FullDocumentDiagnosticReport, + HoverRegistrationOptions, + ImplementationRegistrationOptions, + InitializeParams, + InitializeRequest, + InitializeResponse, + InitializedNotification, + InlayHintRegistrationOptions, + InlayHintResolveRequest, + InlayHintResolveResponse, + InlineCompletionRegistrationOptions, + InlineValueRegistrationOptions, + LinkedEditingRangeRegistrationOptions, + LogTraceNotification, + MonikerRegistrationOptions, + NotebookDocumentDidChangeNotification, + NotebookDocumentDidCloseNotification, + NotebookDocumentDidOpenNotification, + NotebookDocumentDidSaveNotification, + OptionalVersionedTextDocumentIdentifier, + ProgressNotification, + ReferenceRegistrationOptions, + RelatedFullDocumentDiagnosticReport, + RelatedUnchangedDocumentDiagnosticReport, + RenameFile, + RenameRegistrationOptions, + ResponseErrorMessage, + SelectionRangeRegistrationOptions, + SemanticTokensRegistrationOptions, + SetTraceNotification, + ShutdownRequest, + ShutdownResponse, + SignatureHelpRegistrationOptions, + StringValue, + TelemetryEventNotification, + TextDocumentChangeRegistrationOptions, + TextDocumentCodeActionRequest, + TextDocumentCodeActionResponse, + TextDocumentCodeLensRequest, + TextDocumentCodeLensResponse, + TextDocumentColorPresentationOptions, + TextDocumentColorPresentationRequest, + TextDocumentColorPresentationResponse, + TextDocumentCompletionRequest, + TextDocumentCompletionResponse, + TextDocumentDeclarationRequest, + TextDocumentDeclarationResponse, + TextDocumentDefinitionRequest, + TextDocumentDefinitionResponse, + TextDocumentDiagnosticRequest, + TextDocumentDiagnosticResponse, + TextDocumentDidChangeNotification, + TextDocumentDidCloseNotification, + TextDocumentDidOpenNotification, + TextDocumentDidSaveNotification, + TextDocumentDocumentColorRequest, + TextDocumentDocumentColorResponse, + TextDocumentDocumentHighlightRequest, + TextDocumentDocumentHighlightResponse, + TextDocumentDocumentLinkRequest, + TextDocumentDocumentLinkResponse, + TextDocumentDocumentSymbolRequest, + TextDocumentDocumentSymbolResponse, + TextDocumentFoldingRangeRequest, + TextDocumentFoldingRangeResponse, + TextDocumentFormattingRequest, + TextDocumentFormattingResponse, + TextDocumentHoverRequest, + TextDocumentHoverResponse, + TextDocumentImplementationRequest, + TextDocumentImplementationResponse, + TextDocumentInlayHintRequest, + TextDocumentInlayHintResponse, + TextDocumentInlineCompletionRequest, + TextDocumentInlineCompletionResponse, + TextDocumentInlineValueRequest, + TextDocumentInlineValueResponse, + TextDocumentLinkedEditingRangeRequest, + TextDocumentLinkedEditingRangeResponse, + TextDocumentMonikerRequest, + TextDocumentMonikerResponse, + TextDocumentOnTypeFormattingRequest, + TextDocumentOnTypeFormattingResponse, + TextDocumentPrepareCallHierarchyRequest, + TextDocumentPrepareCallHierarchyResponse, + TextDocumentPrepareRenameRequest, + TextDocumentPrepareRenameResponse, + TextDocumentPrepareTypeHierarchyRequest, + TextDocumentPrepareTypeHierarchyResponse, + TextDocumentPublishDiagnosticsNotification, + TextDocumentRangeFormattingRequest, + TextDocumentRangeFormattingResponse, + TextDocumentRangesFormattingRequest, + TextDocumentRangesFormattingResponse, + TextDocumentReferencesRequest, + TextDocumentReferencesResponse, + TextDocumentRegistrationOptions, + TextDocumentRenameRequest, + TextDocumentRenameResponse, + TextDocumentSaveRegistrationOptions, + TextDocumentSelectionRangeRequest, + TextDocumentSelectionRangeResponse, + TextDocumentSemanticTokensFullDeltaRequest, + TextDocumentSemanticTokensFullDeltaResponse, + TextDocumentSemanticTokensFullRequest, + TextDocumentSemanticTokensFullResponse, + TextDocumentSemanticTokensRangeRequest, + TextDocumentSemanticTokensRangeResponse, + TextDocumentSignatureHelpRequest, + TextDocumentSignatureHelpResponse, + TextDocumentTypeDefinitionRequest, + TextDocumentTypeDefinitionResponse, + TextDocumentWillSaveNotification, + TextDocumentWillSaveWaitUntilRequest, + TextDocumentWillSaveWaitUntilResponse, + TypeDefinitionRegistrationOptions, + TypeHierarchyRegistrationOptions, + TypeHierarchySubtypesRequest, + TypeHierarchySubtypesResponse, + TypeHierarchySupertypesRequest, + TypeHierarchySupertypesResponse, + UnchangedDocumentDiagnosticReport, + WindowLogMessageNotification, + WindowShowDocumentRequest, + WindowShowDocumentResponse, + WindowShowMessageNotification, + WindowShowMessageRequestRequest, + WindowShowMessageRequestResponse, + WindowWorkDoneProgressCancelNotification, + WindowWorkDoneProgressCreateRequest, + WindowWorkDoneProgressCreateResponse, + WorkDoneProgressBegin, + WorkDoneProgressEnd, + WorkDoneProgressReport, + WorkspaceApplyEditRequest, + WorkspaceApplyEditResponse, + WorkspaceCodeLensRefreshRequest, + WorkspaceCodeLensRefreshResponse, + WorkspaceConfigurationRequest, + WorkspaceConfigurationResponse, + WorkspaceDiagnosticRefreshRequest, + WorkspaceDiagnosticRefreshResponse, + WorkspaceDiagnosticRequest, + WorkspaceDiagnosticResponse, + WorkspaceDidChangeConfigurationNotification, + WorkspaceDidChangeWatchedFilesNotification, + WorkspaceDidChangeWorkspaceFoldersNotification, + WorkspaceDidCreateFilesNotification, + WorkspaceDidDeleteFilesNotification, + WorkspaceDidRenameFilesNotification, + WorkspaceExecuteCommandRequest, + WorkspaceExecuteCommandResponse, + WorkspaceFoldersInitializeParams, + WorkspaceFoldingRangeRefreshRequest, + WorkspaceFoldingRangeRefreshResponse, + WorkspaceFullDocumentDiagnosticReport, + WorkspaceInlayHintRefreshRequest, + WorkspaceInlayHintRefreshResponse, + WorkspaceInlineValueRefreshRequest, + WorkspaceInlineValueRefreshResponse, + WorkspaceSemanticTokensRefreshRequest, + WorkspaceSemanticTokensRefreshResponse, + WorkspaceSymbolRequest, + WorkspaceSymbolResolveRequest, + WorkspaceSymbolResolveResponse, + WorkspaceSymbolResponse, + WorkspaceUnchangedDocumentDiagnosticReport, + WorkspaceWillCreateFilesRequest, + WorkspaceWillCreateFilesResponse, + WorkspaceWillDeleteFilesRequest, + WorkspaceWillDeleteFilesResponse, + WorkspaceWillRenameFilesRequest, + WorkspaceWillRenameFilesResponse, + WorkspaceWorkspaceFoldersRequest, + WorkspaceWorkspaceFoldersResponse, + _InitializeParams, +] + + +def is_special_class(cls: type) -> bool: + """Returns true if the class or its properties require special handling.""" + return any(cls is c for c in _SPECIAL_CLASSES) + + +_SPECIAL_PROPERTIES = [ + "CallHierarchyIncomingCallsRequest.jsonrpc", + "CallHierarchyIncomingCallsRequest.method", + "CallHierarchyIncomingCallsResponse.jsonrpc", + "CallHierarchyIncomingCallsResponse.result", + "CallHierarchyOutgoingCallsRequest.jsonrpc", + "CallHierarchyOutgoingCallsRequest.method", + "CallHierarchyOutgoingCallsResponse.jsonrpc", + "CallHierarchyOutgoingCallsResponse.result", + "CallHierarchyRegistrationOptions.document_selector", + "CancelRequestNotification.jsonrpc", + "CancelRequestNotification.method", + "ClientRegisterCapabilityRequest.jsonrpc", + "ClientRegisterCapabilityRequest.method", + "ClientRegisterCapabilityResponse.jsonrpc", + "ClientRegisterCapabilityResponse.result", + "ClientUnregisterCapabilityRequest.jsonrpc", + "ClientUnregisterCapabilityRequest.method", + "ClientUnregisterCapabilityResponse.jsonrpc", + "ClientUnregisterCapabilityResponse.result", + "CodeActionRegistrationOptions.document_selector", + "CodeActionResolveRequest.jsonrpc", + "CodeActionResolveRequest.method", + "CodeActionResolveResponse.jsonrpc", + "CodeActionResolveResponse.result", + "CodeLensRegistrationOptions.document_selector", + "CodeLensResolveRequest.jsonrpc", + "CodeLensResolveRequest.method", + "CodeLensResolveResponse.jsonrpc", + "CodeLensResolveResponse.result", + "CompletionItemResolveRequest.jsonrpc", + "CompletionItemResolveRequest.method", + "CompletionItemResolveResponse.jsonrpc", + "CompletionItemResolveResponse.result", + "CompletionRegistrationOptions.document_selector", + "CreateFile.kind", + "DeclarationRegistrationOptions.document_selector", + "DefinitionRegistrationOptions.document_selector", + "DeleteFile.kind", + "DiagnosticRegistrationOptions.document_selector", + "DocumentColorRegistrationOptions.document_selector", + "DocumentFormattingRegistrationOptions.document_selector", + "DocumentHighlightRegistrationOptions.document_selector", + "DocumentLinkRegistrationOptions.document_selector", + "DocumentLinkResolveRequest.jsonrpc", + "DocumentLinkResolveRequest.method", + "DocumentLinkResolveResponse.jsonrpc", + "DocumentLinkResolveResponse.result", + "DocumentOnTypeFormattingRegistrationOptions.document_selector", + "DocumentRangeFormattingRegistrationOptions.document_selector", + "DocumentSymbolRegistrationOptions.document_selector", + "ExitNotification.jsonrpc", + "ExitNotification.method", + "FoldingRangeRegistrationOptions.document_selector", + "FullDocumentDiagnosticReport.kind", + "HoverRegistrationOptions.document_selector", + "ImplementationRegistrationOptions.document_selector", + "InitializeParams.process_id", + "InitializeParams.root_path", + "InitializeParams.root_uri", + "InitializeParams.workspace_folders", + "InitializeRequest.jsonrpc", + "InitializeRequest.method", + "InitializeResponse.jsonrpc", + "InitializeResponse.result", + "InitializedNotification.jsonrpc", + "InitializedNotification.method", + "InlayHintRegistrationOptions.document_selector", + "InlayHintResolveRequest.jsonrpc", + "InlayHintResolveRequest.method", + "InlayHintResolveResponse.jsonrpc", + "InlayHintResolveResponse.result", + "InlineCompletionRegistrationOptions.document_selector", + "InlineValueRegistrationOptions.document_selector", + "LinkedEditingRangeRegistrationOptions.document_selector", + "LogTraceNotification.jsonrpc", + "LogTraceNotification.method", + "MonikerRegistrationOptions.document_selector", + "NotebookDocumentDidChangeNotification.jsonrpc", + "NotebookDocumentDidChangeNotification.method", + "NotebookDocumentDidCloseNotification.jsonrpc", + "NotebookDocumentDidCloseNotification.method", + "NotebookDocumentDidOpenNotification.jsonrpc", + "NotebookDocumentDidOpenNotification.method", + "NotebookDocumentDidSaveNotification.jsonrpc", + "NotebookDocumentDidSaveNotification.method", + "OptionalVersionedTextDocumentIdentifier.version", + "ProgressNotification.jsonrpc", + "ProgressNotification.method", + "ReferenceRegistrationOptions.document_selector", + "RelatedFullDocumentDiagnosticReport.kind", + "RelatedUnchangedDocumentDiagnosticReport.kind", + "RenameFile.kind", + "RenameRegistrationOptions.document_selector", + "ResponseErrorMessage.error", + "ResponseErrorMessage.jsonrpc", + "SelectionRangeRegistrationOptions.document_selector", + "SemanticTokensRegistrationOptions.document_selector", + "SetTraceNotification.jsonrpc", + "SetTraceNotification.method", + "ShutdownRequest.jsonrpc", + "ShutdownRequest.method", + "ShutdownResponse.jsonrpc", + "ShutdownResponse.result", + "SignatureHelpRegistrationOptions.document_selector", + "StringValue.kind", + "TelemetryEventNotification.jsonrpc", + "TelemetryEventNotification.method", + "TextDocumentChangeRegistrationOptions.document_selector", + "TextDocumentCodeActionRequest.jsonrpc", + "TextDocumentCodeActionRequest.method", + "TextDocumentCodeActionResponse.jsonrpc", + "TextDocumentCodeActionResponse.result", + "TextDocumentCodeLensRequest.jsonrpc", + "TextDocumentCodeLensRequest.method", + "TextDocumentCodeLensResponse.jsonrpc", + "TextDocumentCodeLensResponse.result", + "TextDocumentColorPresentationOptions.document_selector", + "TextDocumentColorPresentationRequest.jsonrpc", + "TextDocumentColorPresentationRequest.method", + "TextDocumentColorPresentationResponse.jsonrpc", + "TextDocumentColorPresentationResponse.result", + "TextDocumentCompletionRequest.jsonrpc", + "TextDocumentCompletionRequest.method", + "TextDocumentCompletionResponse.jsonrpc", + "TextDocumentCompletionResponse.result", + "TextDocumentDeclarationRequest.jsonrpc", + "TextDocumentDeclarationRequest.method", + "TextDocumentDeclarationResponse.jsonrpc", + "TextDocumentDeclarationResponse.result", + "TextDocumentDefinitionRequest.jsonrpc", + "TextDocumentDefinitionRequest.method", + "TextDocumentDefinitionResponse.jsonrpc", + "TextDocumentDefinitionResponse.result", + "TextDocumentDiagnosticRequest.jsonrpc", + "TextDocumentDiagnosticRequest.method", + "TextDocumentDiagnosticResponse.jsonrpc", + "TextDocumentDiagnosticResponse.result", + "TextDocumentDidChangeNotification.jsonrpc", + "TextDocumentDidChangeNotification.method", + "TextDocumentDidCloseNotification.jsonrpc", + "TextDocumentDidCloseNotification.method", + "TextDocumentDidOpenNotification.jsonrpc", + "TextDocumentDidOpenNotification.method", + "TextDocumentDidSaveNotification.jsonrpc", + "TextDocumentDidSaveNotification.method", + "TextDocumentDocumentColorRequest.jsonrpc", + "TextDocumentDocumentColorRequest.method", + "TextDocumentDocumentColorResponse.jsonrpc", + "TextDocumentDocumentColorResponse.result", + "TextDocumentDocumentHighlightRequest.jsonrpc", + "TextDocumentDocumentHighlightRequest.method", + "TextDocumentDocumentHighlightResponse.jsonrpc", + "TextDocumentDocumentHighlightResponse.result", + "TextDocumentDocumentLinkRequest.jsonrpc", + "TextDocumentDocumentLinkRequest.method", + "TextDocumentDocumentLinkResponse.jsonrpc", + "TextDocumentDocumentLinkResponse.result", + "TextDocumentDocumentSymbolRequest.jsonrpc", + "TextDocumentDocumentSymbolRequest.method", + "TextDocumentDocumentSymbolResponse.jsonrpc", + "TextDocumentDocumentSymbolResponse.result", + "TextDocumentFoldingRangeRequest.jsonrpc", + "TextDocumentFoldingRangeRequest.method", + "TextDocumentFoldingRangeResponse.jsonrpc", + "TextDocumentFoldingRangeResponse.result", + "TextDocumentFormattingRequest.jsonrpc", + "TextDocumentFormattingRequest.method", + "TextDocumentFormattingResponse.jsonrpc", + "TextDocumentFormattingResponse.result", + "TextDocumentHoverRequest.jsonrpc", + "TextDocumentHoverRequest.method", + "TextDocumentHoverResponse.jsonrpc", + "TextDocumentHoverResponse.result", + "TextDocumentImplementationRequest.jsonrpc", + "TextDocumentImplementationRequest.method", + "TextDocumentImplementationResponse.jsonrpc", + "TextDocumentImplementationResponse.result", + "TextDocumentInlayHintRequest.jsonrpc", + "TextDocumentInlayHintRequest.method", + "TextDocumentInlayHintResponse.jsonrpc", + "TextDocumentInlayHintResponse.result", + "TextDocumentInlineCompletionRequest.jsonrpc", + "TextDocumentInlineCompletionRequest.method", + "TextDocumentInlineCompletionResponse.jsonrpc", + "TextDocumentInlineCompletionResponse.result", + "TextDocumentInlineValueRequest.jsonrpc", + "TextDocumentInlineValueRequest.method", + "TextDocumentInlineValueResponse.jsonrpc", + "TextDocumentInlineValueResponse.result", + "TextDocumentLinkedEditingRangeRequest.jsonrpc", + "TextDocumentLinkedEditingRangeRequest.method", + "TextDocumentLinkedEditingRangeResponse.jsonrpc", + "TextDocumentLinkedEditingRangeResponse.result", + "TextDocumentMonikerRequest.jsonrpc", + "TextDocumentMonikerRequest.method", + "TextDocumentMonikerResponse.jsonrpc", + "TextDocumentMonikerResponse.result", + "TextDocumentOnTypeFormattingRequest.jsonrpc", + "TextDocumentOnTypeFormattingRequest.method", + "TextDocumentOnTypeFormattingResponse.jsonrpc", + "TextDocumentOnTypeFormattingResponse.result", + "TextDocumentPrepareCallHierarchyRequest.jsonrpc", + "TextDocumentPrepareCallHierarchyRequest.method", + "TextDocumentPrepareCallHierarchyResponse.jsonrpc", + "TextDocumentPrepareCallHierarchyResponse.result", + "TextDocumentPrepareRenameRequest.jsonrpc", + "TextDocumentPrepareRenameRequest.method", + "TextDocumentPrepareRenameResponse.jsonrpc", + "TextDocumentPrepareRenameResponse.result", + "TextDocumentPrepareTypeHierarchyRequest.jsonrpc", + "TextDocumentPrepareTypeHierarchyRequest.method", + "TextDocumentPrepareTypeHierarchyResponse.jsonrpc", + "TextDocumentPrepareTypeHierarchyResponse.result", + "TextDocumentPublishDiagnosticsNotification.jsonrpc", + "TextDocumentPublishDiagnosticsNotification.method", + "TextDocumentRangeFormattingRequest.jsonrpc", + "TextDocumentRangeFormattingRequest.method", + "TextDocumentRangeFormattingResponse.jsonrpc", + "TextDocumentRangeFormattingResponse.result", + "TextDocumentRangesFormattingRequest.jsonrpc", + "TextDocumentRangesFormattingRequest.method", + "TextDocumentRangesFormattingResponse.jsonrpc", + "TextDocumentRangesFormattingResponse.result", + "TextDocumentReferencesRequest.jsonrpc", + "TextDocumentReferencesRequest.method", + "TextDocumentReferencesResponse.jsonrpc", + "TextDocumentReferencesResponse.result", + "TextDocumentRegistrationOptions.document_selector", + "TextDocumentRenameRequest.jsonrpc", + "TextDocumentRenameRequest.method", + "TextDocumentRenameResponse.jsonrpc", + "TextDocumentRenameResponse.result", + "TextDocumentSaveRegistrationOptions.document_selector", + "TextDocumentSelectionRangeRequest.jsonrpc", + "TextDocumentSelectionRangeRequest.method", + "TextDocumentSelectionRangeResponse.jsonrpc", + "TextDocumentSelectionRangeResponse.result", + "TextDocumentSemanticTokensFullDeltaRequest.jsonrpc", + "TextDocumentSemanticTokensFullDeltaRequest.method", + "TextDocumentSemanticTokensFullDeltaResponse.jsonrpc", + "TextDocumentSemanticTokensFullDeltaResponse.result", + "TextDocumentSemanticTokensFullRequest.jsonrpc", + "TextDocumentSemanticTokensFullRequest.method", + "TextDocumentSemanticTokensFullResponse.jsonrpc", + "TextDocumentSemanticTokensFullResponse.result", + "TextDocumentSemanticTokensRangeRequest.jsonrpc", + "TextDocumentSemanticTokensRangeRequest.method", + "TextDocumentSemanticTokensRangeResponse.jsonrpc", + "TextDocumentSemanticTokensRangeResponse.result", + "TextDocumentSignatureHelpRequest.jsonrpc", + "TextDocumentSignatureHelpRequest.method", + "TextDocumentSignatureHelpResponse.jsonrpc", + "TextDocumentSignatureHelpResponse.result", + "TextDocumentTypeDefinitionRequest.jsonrpc", + "TextDocumentTypeDefinitionRequest.method", + "TextDocumentTypeDefinitionResponse.jsonrpc", + "TextDocumentTypeDefinitionResponse.result", + "TextDocumentWillSaveNotification.jsonrpc", + "TextDocumentWillSaveNotification.method", + "TextDocumentWillSaveWaitUntilRequest.jsonrpc", + "TextDocumentWillSaveWaitUntilRequest.method", + "TextDocumentWillSaveWaitUntilResponse.jsonrpc", + "TextDocumentWillSaveWaitUntilResponse.result", + "TypeDefinitionRegistrationOptions.document_selector", + "TypeHierarchyRegistrationOptions.document_selector", + "TypeHierarchySubtypesRequest.jsonrpc", + "TypeHierarchySubtypesRequest.method", + "TypeHierarchySubtypesResponse.jsonrpc", + "TypeHierarchySubtypesResponse.result", + "TypeHierarchySupertypesRequest.jsonrpc", + "TypeHierarchySupertypesRequest.method", + "TypeHierarchySupertypesResponse.jsonrpc", + "TypeHierarchySupertypesResponse.result", + "UnchangedDocumentDiagnosticReport.kind", + "WindowLogMessageNotification.jsonrpc", + "WindowLogMessageNotification.method", + "WindowShowDocumentRequest.jsonrpc", + "WindowShowDocumentRequest.method", + "WindowShowDocumentResponse.jsonrpc", + "WindowShowDocumentResponse.result", + "WindowShowMessageNotification.jsonrpc", + "WindowShowMessageNotification.method", + "WindowShowMessageRequestRequest.jsonrpc", + "WindowShowMessageRequestRequest.method", + "WindowShowMessageRequestResponse.jsonrpc", + "WindowShowMessageRequestResponse.result", + "WindowWorkDoneProgressCancelNotification.jsonrpc", + "WindowWorkDoneProgressCancelNotification.method", + "WindowWorkDoneProgressCreateRequest.jsonrpc", + "WindowWorkDoneProgressCreateRequest.method", + "WindowWorkDoneProgressCreateResponse.jsonrpc", + "WindowWorkDoneProgressCreateResponse.result", + "WorkDoneProgressBegin.kind", + "WorkDoneProgressEnd.kind", + "WorkDoneProgressReport.kind", + "WorkspaceApplyEditRequest.jsonrpc", + "WorkspaceApplyEditRequest.method", + "WorkspaceApplyEditResponse.jsonrpc", + "WorkspaceApplyEditResponse.result", + "WorkspaceCodeLensRefreshRequest.jsonrpc", + "WorkspaceCodeLensRefreshRequest.method", + "WorkspaceCodeLensRefreshResponse.jsonrpc", + "WorkspaceCodeLensRefreshResponse.result", + "WorkspaceConfigurationRequest.jsonrpc", + "WorkspaceConfigurationRequest.method", + "WorkspaceConfigurationResponse.jsonrpc", + "WorkspaceConfigurationResponse.result", + "WorkspaceDiagnosticRefreshRequest.jsonrpc", + "WorkspaceDiagnosticRefreshRequest.method", + "WorkspaceDiagnosticRefreshResponse.jsonrpc", + "WorkspaceDiagnosticRefreshResponse.result", + "WorkspaceDiagnosticRequest.jsonrpc", + "WorkspaceDiagnosticRequest.method", + "WorkspaceDiagnosticResponse.jsonrpc", + "WorkspaceDiagnosticResponse.result", + "WorkspaceDidChangeConfigurationNotification.jsonrpc", + "WorkspaceDidChangeConfigurationNotification.method", + "WorkspaceDidChangeWatchedFilesNotification.jsonrpc", + "WorkspaceDidChangeWatchedFilesNotification.method", + "WorkspaceDidChangeWorkspaceFoldersNotification.jsonrpc", + "WorkspaceDidChangeWorkspaceFoldersNotification.method", + "WorkspaceDidCreateFilesNotification.jsonrpc", + "WorkspaceDidCreateFilesNotification.method", + "WorkspaceDidDeleteFilesNotification.jsonrpc", + "WorkspaceDidDeleteFilesNotification.method", + "WorkspaceDidRenameFilesNotification.jsonrpc", + "WorkspaceDidRenameFilesNotification.method", + "WorkspaceExecuteCommandRequest.jsonrpc", + "WorkspaceExecuteCommandRequest.method", + "WorkspaceExecuteCommandResponse.jsonrpc", + "WorkspaceExecuteCommandResponse.result", + "WorkspaceFoldersInitializeParams.workspace_folders", + "WorkspaceFoldingRangeRefreshRequest.jsonrpc", + "WorkspaceFoldingRangeRefreshRequest.method", + "WorkspaceFoldingRangeRefreshResponse.jsonrpc", + "WorkspaceFoldingRangeRefreshResponse.result", + "WorkspaceFullDocumentDiagnosticReport.kind", + "WorkspaceFullDocumentDiagnosticReport.version", + "WorkspaceInlayHintRefreshRequest.jsonrpc", + "WorkspaceInlayHintRefreshRequest.method", + "WorkspaceInlayHintRefreshResponse.jsonrpc", + "WorkspaceInlayHintRefreshResponse.result", + "WorkspaceInlineValueRefreshRequest.jsonrpc", + "WorkspaceInlineValueRefreshRequest.method", + "WorkspaceInlineValueRefreshResponse.jsonrpc", + "WorkspaceInlineValueRefreshResponse.result", + "WorkspaceSemanticTokensRefreshRequest.jsonrpc", + "WorkspaceSemanticTokensRefreshRequest.method", + "WorkspaceSemanticTokensRefreshResponse.jsonrpc", + "WorkspaceSemanticTokensRefreshResponse.result", + "WorkspaceSymbolRequest.jsonrpc", + "WorkspaceSymbolRequest.method", + "WorkspaceSymbolResolveRequest.jsonrpc", + "WorkspaceSymbolResolveRequest.method", + "WorkspaceSymbolResolveResponse.jsonrpc", + "WorkspaceSymbolResolveResponse.result", + "WorkspaceSymbolResponse.jsonrpc", + "WorkspaceSymbolResponse.result", + "WorkspaceUnchangedDocumentDiagnosticReport.kind", + "WorkspaceUnchangedDocumentDiagnosticReport.version", + "WorkspaceWillCreateFilesRequest.jsonrpc", + "WorkspaceWillCreateFilesRequest.method", + "WorkspaceWillCreateFilesResponse.jsonrpc", + "WorkspaceWillCreateFilesResponse.result", + "WorkspaceWillDeleteFilesRequest.jsonrpc", + "WorkspaceWillDeleteFilesRequest.method", + "WorkspaceWillDeleteFilesResponse.jsonrpc", + "WorkspaceWillDeleteFilesResponse.result", + "WorkspaceWillRenameFilesRequest.jsonrpc", + "WorkspaceWillRenameFilesRequest.method", + "WorkspaceWillRenameFilesResponse.jsonrpc", + "WorkspaceWillRenameFilesResponse.result", + "WorkspaceWorkspaceFoldersRequest.jsonrpc", + "WorkspaceWorkspaceFoldersRequest.method", + "WorkspaceWorkspaceFoldersResponse.jsonrpc", + "WorkspaceWorkspaceFoldersResponse.result", + "_InitializeParams.process_id", + "_InitializeParams.root_path", + "_InitializeParams.root_uri", +] + + +def is_special_property(cls: type, property_name: str) -> bool: + """Returns true if the class or its properties require special handling. + Example: + Consider RenameRegistrationOptions + * document_selector property: + When you set `document_selector` to None in python it has to be preserved when + serializing it. Since the serialized JSON value `{"document_selector": null}` + means use the Clients document selector. Omitting it might throw error. + * prepare_provider property + This property does NOT need special handling, since omitting it or using + `{"prepare_provider": null}` in JSON has the same meaning. + """ + qualified_name = f"{cls.__name__}.{property_name}" + return qualified_name in _SPECIAL_PROPERTIES + + +ALL_TYPES_MAP: Dict[str, Union[type, object]] = { + "AnnotatedTextEdit": AnnotatedTextEdit, + "ApplyWorkspaceEditParams": ApplyWorkspaceEditParams, + "ApplyWorkspaceEditResult": ApplyWorkspaceEditResult, + "BaseSymbolInformation": BaseSymbolInformation, + "CallHierarchyClientCapabilities": CallHierarchyClientCapabilities, + "CallHierarchyIncomingCall": CallHierarchyIncomingCall, + "CallHierarchyIncomingCallsParams": CallHierarchyIncomingCallsParams, + "CallHierarchyIncomingCallsRequest": CallHierarchyIncomingCallsRequest, + "CallHierarchyIncomingCallsResponse": CallHierarchyIncomingCallsResponse, + "CallHierarchyItem": CallHierarchyItem, + "CallHierarchyOptions": CallHierarchyOptions, + "CallHierarchyOutgoingCall": CallHierarchyOutgoingCall, + "CallHierarchyOutgoingCallsParams": CallHierarchyOutgoingCallsParams, + "CallHierarchyOutgoingCallsRequest": CallHierarchyOutgoingCallsRequest, + "CallHierarchyOutgoingCallsResponse": CallHierarchyOutgoingCallsResponse, + "CallHierarchyPrepareParams": CallHierarchyPrepareParams, + "CallHierarchyRegistrationOptions": CallHierarchyRegistrationOptions, + "CancelParams": CancelParams, + "CancelRequestNotification": CancelRequestNotification, + "ChangeAnnotation": ChangeAnnotation, + "ChangeAnnotationIdentifier": ChangeAnnotationIdentifier, + "ChangeAnnotationsSupportOptions": ChangeAnnotationsSupportOptions, + "ClientCapabilities": ClientCapabilities, + "ClientCodeActionKindOptions": ClientCodeActionKindOptions, + "ClientCodeActionLiteralOptions": ClientCodeActionLiteralOptions, + "ClientCodeActionResolveOptions": ClientCodeActionResolveOptions, + "ClientCompletionItemInsertTextModeOptions": ClientCompletionItemInsertTextModeOptions, + "ClientCompletionItemOptions": ClientCompletionItemOptions, + "ClientCompletionItemOptionsKind": ClientCompletionItemOptionsKind, + "ClientCompletionItemResolveOptions": ClientCompletionItemResolveOptions, + "ClientDiagnosticsTagOptions": ClientDiagnosticsTagOptions, + "ClientFoldingRangeKindOptions": ClientFoldingRangeKindOptions, + "ClientFoldingRangeOptions": ClientFoldingRangeOptions, + "ClientInfo": ClientInfo, + "ClientInlayHintResolveOptions": ClientInlayHintResolveOptions, + "ClientRegisterCapabilityRequest": ClientRegisterCapabilityRequest, + "ClientRegisterCapabilityResponse": ClientRegisterCapabilityResponse, + "ClientSemanticTokensRequestFullDelta": ClientSemanticTokensRequestFullDelta, + "ClientSemanticTokensRequestOptions": ClientSemanticTokensRequestOptions, + "ClientShowMessageActionItemOptions": ClientShowMessageActionItemOptions, + "ClientSignatureInformationOptions": ClientSignatureInformationOptions, + "ClientSignatureParameterInformationOptions": ClientSignatureParameterInformationOptions, + "ClientSymbolKindOptions": ClientSymbolKindOptions, + "ClientSymbolResolveOptions": ClientSymbolResolveOptions, + "ClientSymbolTagOptions": ClientSymbolTagOptions, + "ClientUnregisterCapabilityRequest": ClientUnregisterCapabilityRequest, + "ClientUnregisterCapabilityResponse": ClientUnregisterCapabilityResponse, + "CodeAction": CodeAction, + "CodeActionClientCapabilities": CodeActionClientCapabilities, + "CodeActionContext": CodeActionContext, + "CodeActionDisabled": CodeActionDisabled, + "CodeActionKind": CodeActionKind, + "CodeActionOptions": CodeActionOptions, + "CodeActionParams": CodeActionParams, + "CodeActionRegistrationOptions": CodeActionRegistrationOptions, + "CodeActionResolveRequest": CodeActionResolveRequest, + "CodeActionResolveResponse": CodeActionResolveResponse, + "CodeActionTriggerKind": CodeActionTriggerKind, + "CodeDescription": CodeDescription, + "CodeLens": CodeLens, + "CodeLensClientCapabilities": CodeLensClientCapabilities, + "CodeLensOptions": CodeLensOptions, + "CodeLensParams": CodeLensParams, + "CodeLensRegistrationOptions": CodeLensRegistrationOptions, + "CodeLensResolveRequest": CodeLensResolveRequest, + "CodeLensResolveResponse": CodeLensResolveResponse, + "CodeLensWorkspaceClientCapabilities": CodeLensWorkspaceClientCapabilities, + "Color": Color, + "ColorInformation": ColorInformation, + "ColorPresentation": ColorPresentation, + "ColorPresentationParams": ColorPresentationParams, + "Command": Command, + "CompletionClientCapabilities": CompletionClientCapabilities, + "CompletionContext": CompletionContext, + "CompletionItem": CompletionItem, + "CompletionItemDefaults": CompletionItemDefaults, + "CompletionItemKind": CompletionItemKind, + "CompletionItemLabelDetails": CompletionItemLabelDetails, + "CompletionItemResolveRequest": CompletionItemResolveRequest, + "CompletionItemResolveResponse": CompletionItemResolveResponse, + "CompletionItemTag": CompletionItemTag, + "CompletionItemTagOptions": CompletionItemTagOptions, + "CompletionList": CompletionList, + "CompletionListCapabilities": CompletionListCapabilities, + "CompletionOptions": CompletionOptions, + "CompletionParams": CompletionParams, + "CompletionRegistrationOptions": CompletionRegistrationOptions, + "CompletionTriggerKind": CompletionTriggerKind, + "ConfigurationItem": ConfigurationItem, + "ConfigurationParams": ConfigurationParams, + "CreateFile": CreateFile, + "CreateFileOptions": CreateFileOptions, + "CreateFilesParams": CreateFilesParams, + "Declaration": Declaration, + "DeclarationClientCapabilities": DeclarationClientCapabilities, + "DeclarationLink": DeclarationLink, + "DeclarationOptions": DeclarationOptions, + "DeclarationParams": DeclarationParams, + "DeclarationRegistrationOptions": DeclarationRegistrationOptions, + "Definition": Definition, + "DefinitionClientCapabilities": DefinitionClientCapabilities, + "DefinitionLink": DefinitionLink, + "DefinitionOptions": DefinitionOptions, + "DefinitionParams": DefinitionParams, + "DefinitionRegistrationOptions": DefinitionRegistrationOptions, + "DeleteFile": DeleteFile, + "DeleteFileOptions": DeleteFileOptions, + "DeleteFilesParams": DeleteFilesParams, + "Diagnostic": Diagnostic, + "DiagnosticClientCapabilities": DiagnosticClientCapabilities, + "DiagnosticOptions": DiagnosticOptions, + "DiagnosticRegistrationOptions": DiagnosticRegistrationOptions, + "DiagnosticRelatedInformation": DiagnosticRelatedInformation, + "DiagnosticServerCancellationData": DiagnosticServerCancellationData, + "DiagnosticSeverity": DiagnosticSeverity, + "DiagnosticTag": DiagnosticTag, + "DiagnosticWorkspaceClientCapabilities": DiagnosticWorkspaceClientCapabilities, + "DidChangeConfigurationClientCapabilities": DidChangeConfigurationClientCapabilities, + "DidChangeConfigurationParams": DidChangeConfigurationParams, + "DidChangeConfigurationRegistrationOptions": DidChangeConfigurationRegistrationOptions, + "DidChangeNotebookDocumentParams": DidChangeNotebookDocumentParams, + "DidChangeTextDocumentParams": DidChangeTextDocumentParams, + "DidChangeWatchedFilesClientCapabilities": DidChangeWatchedFilesClientCapabilities, + "DidChangeWatchedFilesParams": DidChangeWatchedFilesParams, + "DidChangeWatchedFilesRegistrationOptions": DidChangeWatchedFilesRegistrationOptions, + "DidChangeWorkspaceFoldersParams": DidChangeWorkspaceFoldersParams, + "DidCloseNotebookDocumentParams": DidCloseNotebookDocumentParams, + "DidCloseTextDocumentParams": DidCloseTextDocumentParams, + "DidOpenNotebookDocumentParams": DidOpenNotebookDocumentParams, + "DidOpenTextDocumentParams": DidOpenTextDocumentParams, + "DidSaveNotebookDocumentParams": DidSaveNotebookDocumentParams, + "DidSaveTextDocumentParams": DidSaveTextDocumentParams, + "DocumentColorClientCapabilities": DocumentColorClientCapabilities, + "DocumentColorOptions": DocumentColorOptions, + "DocumentColorParams": DocumentColorParams, + "DocumentColorRegistrationOptions": DocumentColorRegistrationOptions, + "DocumentDiagnosticParams": DocumentDiagnosticParams, + "DocumentDiagnosticReport": DocumentDiagnosticReport, + "DocumentDiagnosticReportKind": DocumentDiagnosticReportKind, + "DocumentDiagnosticReportPartialResult": DocumentDiagnosticReportPartialResult, + "DocumentFilter": DocumentFilter, + "DocumentFormattingClientCapabilities": DocumentFormattingClientCapabilities, + "DocumentFormattingOptions": DocumentFormattingOptions, + "DocumentFormattingParams": DocumentFormattingParams, + "DocumentFormattingRegistrationOptions": DocumentFormattingRegistrationOptions, + "DocumentHighlight": DocumentHighlight, + "DocumentHighlightClientCapabilities": DocumentHighlightClientCapabilities, + "DocumentHighlightKind": DocumentHighlightKind, + "DocumentHighlightOptions": DocumentHighlightOptions, + "DocumentHighlightParams": DocumentHighlightParams, + "DocumentHighlightRegistrationOptions": DocumentHighlightRegistrationOptions, + "DocumentLink": DocumentLink, + "DocumentLinkClientCapabilities": DocumentLinkClientCapabilities, + "DocumentLinkOptions": DocumentLinkOptions, + "DocumentLinkParams": DocumentLinkParams, + "DocumentLinkRegistrationOptions": DocumentLinkRegistrationOptions, + "DocumentLinkResolveRequest": DocumentLinkResolveRequest, + "DocumentLinkResolveResponse": DocumentLinkResolveResponse, + "DocumentOnTypeFormattingClientCapabilities": DocumentOnTypeFormattingClientCapabilities, + "DocumentOnTypeFormattingOptions": DocumentOnTypeFormattingOptions, + "DocumentOnTypeFormattingParams": DocumentOnTypeFormattingParams, + "DocumentOnTypeFormattingRegistrationOptions": DocumentOnTypeFormattingRegistrationOptions, + "DocumentRangeFormattingClientCapabilities": DocumentRangeFormattingClientCapabilities, + "DocumentRangeFormattingOptions": DocumentRangeFormattingOptions, + "DocumentRangeFormattingParams": DocumentRangeFormattingParams, + "DocumentRangeFormattingRegistrationOptions": DocumentRangeFormattingRegistrationOptions, + "DocumentRangesFormattingParams": DocumentRangesFormattingParams, + "DocumentSelector": DocumentSelector, + "DocumentSymbol": DocumentSymbol, + "DocumentSymbolClientCapabilities": DocumentSymbolClientCapabilities, + "DocumentSymbolOptions": DocumentSymbolOptions, + "DocumentSymbolParams": DocumentSymbolParams, + "DocumentSymbolRegistrationOptions": DocumentSymbolRegistrationOptions, + "EditRangeWithInsertReplace": EditRangeWithInsertReplace, + "ErrorCodes": ErrorCodes, + "ExecuteCommandClientCapabilities": ExecuteCommandClientCapabilities, + "ExecuteCommandOptions": ExecuteCommandOptions, + "ExecuteCommandParams": ExecuteCommandParams, + "ExecuteCommandRegistrationOptions": ExecuteCommandRegistrationOptions, + "ExecutionSummary": ExecutionSummary, + "ExitNotification": ExitNotification, + "FailureHandlingKind": FailureHandlingKind, + "FileChangeType": FileChangeType, + "FileCreate": FileCreate, + "FileDelete": FileDelete, + "FileEvent": FileEvent, + "FileOperationClientCapabilities": FileOperationClientCapabilities, + "FileOperationFilter": FileOperationFilter, + "FileOperationOptions": FileOperationOptions, + "FileOperationPattern": FileOperationPattern, + "FileOperationPatternKind": FileOperationPatternKind, + "FileOperationPatternOptions": FileOperationPatternOptions, + "FileOperationRegistrationOptions": FileOperationRegistrationOptions, + "FileRename": FileRename, + "FileSystemWatcher": FileSystemWatcher, + "FoldingRange": FoldingRange, + "FoldingRangeClientCapabilities": FoldingRangeClientCapabilities, + "FoldingRangeKind": FoldingRangeKind, + "FoldingRangeOptions": FoldingRangeOptions, + "FoldingRangeParams": FoldingRangeParams, + "FoldingRangeRegistrationOptions": FoldingRangeRegistrationOptions, + "FoldingRangeWorkspaceClientCapabilities": FoldingRangeWorkspaceClientCapabilities, + "FormattingOptions": FormattingOptions, + "FullDocumentDiagnosticReport": FullDocumentDiagnosticReport, + "GeneralClientCapabilities": GeneralClientCapabilities, + "GlobPattern": GlobPattern, + "Hover": Hover, + "HoverClientCapabilities": HoverClientCapabilities, + "HoverOptions": HoverOptions, + "HoverParams": HoverParams, + "HoverRegistrationOptions": HoverRegistrationOptions, + "ImplementationClientCapabilities": ImplementationClientCapabilities, + "ImplementationOptions": ImplementationOptions, + "ImplementationParams": ImplementationParams, + "ImplementationRegistrationOptions": ImplementationRegistrationOptions, + "InitializeError": InitializeError, + "InitializeParams": InitializeParams, + "InitializeRequest": InitializeRequest, + "InitializeResponse": InitializeResponse, + "InitializeResult": InitializeResult, + "InitializedNotification": InitializedNotification, + "InitializedParams": InitializedParams, + "InlayHint": InlayHint, + "InlayHintClientCapabilities": InlayHintClientCapabilities, + "InlayHintKind": InlayHintKind, + "InlayHintLabelPart": InlayHintLabelPart, + "InlayHintOptions": InlayHintOptions, + "InlayHintParams": InlayHintParams, + "InlayHintRegistrationOptions": InlayHintRegistrationOptions, + "InlayHintResolveRequest": InlayHintResolveRequest, + "InlayHintResolveResponse": InlayHintResolveResponse, + "InlayHintWorkspaceClientCapabilities": InlayHintWorkspaceClientCapabilities, + "InlineCompletionClientCapabilities": InlineCompletionClientCapabilities, + "InlineCompletionContext": InlineCompletionContext, + "InlineCompletionItem": InlineCompletionItem, + "InlineCompletionList": InlineCompletionList, + "InlineCompletionOptions": InlineCompletionOptions, + "InlineCompletionParams": InlineCompletionParams, + "InlineCompletionRegistrationOptions": InlineCompletionRegistrationOptions, + "InlineCompletionTriggerKind": InlineCompletionTriggerKind, + "InlineValue": InlineValue, + "InlineValueClientCapabilities": InlineValueClientCapabilities, + "InlineValueContext": InlineValueContext, + "InlineValueEvaluatableExpression": InlineValueEvaluatableExpression, + "InlineValueOptions": InlineValueOptions, + "InlineValueParams": InlineValueParams, + "InlineValueRegistrationOptions": InlineValueRegistrationOptions, + "InlineValueText": InlineValueText, + "InlineValueVariableLookup": InlineValueVariableLookup, + "InlineValueWorkspaceClientCapabilities": InlineValueWorkspaceClientCapabilities, + "InsertReplaceEdit": InsertReplaceEdit, + "InsertTextFormat": InsertTextFormat, + "InsertTextMode": InsertTextMode, + "LSPAny": LSPAny, + "LSPArray": LSPArray, + "LSPErrorCodes": LSPErrorCodes, + "LSPObject": LSPObject, + "LinkedEditingRangeClientCapabilities": LinkedEditingRangeClientCapabilities, + "LinkedEditingRangeOptions": LinkedEditingRangeOptions, + "LinkedEditingRangeParams": LinkedEditingRangeParams, + "LinkedEditingRangeRegistrationOptions": LinkedEditingRangeRegistrationOptions, + "LinkedEditingRanges": LinkedEditingRanges, + "Location": Location, + "LocationLink": LocationLink, + "LocationUriOnly": LocationUriOnly, + "LogMessageParams": LogMessageParams, + "LogTraceNotification": LogTraceNotification, + "LogTraceParams": LogTraceParams, + "MarkdownClientCapabilities": MarkdownClientCapabilities, + "MarkedString": MarkedString, + "MarkedStringWithLanguage": MarkedStringWithLanguage, + "MarkupContent": MarkupContent, + "MarkupKind": MarkupKind, + "MessageActionItem": MessageActionItem, + "MessageDirection": MessageDirection, + "MessageType": MessageType, + "Moniker": Moniker, + "MonikerClientCapabilities": MonikerClientCapabilities, + "MonikerKind": MonikerKind, + "MonikerOptions": MonikerOptions, + "MonikerParams": MonikerParams, + "MonikerRegistrationOptions": MonikerRegistrationOptions, + "NotebookCell": NotebookCell, + "NotebookCellArrayChange": NotebookCellArrayChange, + "NotebookCellKind": NotebookCellKind, + "NotebookCellLanguage": NotebookCellLanguage, + "NotebookCellTextDocumentFilter": NotebookCellTextDocumentFilter, + "NotebookDocument": NotebookDocument, + "NotebookDocumentCellChangeStructure": NotebookDocumentCellChangeStructure, + "NotebookDocumentCellChanges": NotebookDocumentCellChanges, + "NotebookDocumentCellContentChanges": NotebookDocumentCellContentChanges, + "NotebookDocumentChangeEvent": NotebookDocumentChangeEvent, + "NotebookDocumentClientCapabilities": NotebookDocumentClientCapabilities, + "NotebookDocumentDidChangeNotification": NotebookDocumentDidChangeNotification, + "NotebookDocumentDidCloseNotification": NotebookDocumentDidCloseNotification, + "NotebookDocumentDidOpenNotification": NotebookDocumentDidOpenNotification, + "NotebookDocumentDidSaveNotification": NotebookDocumentDidSaveNotification, + "NotebookDocumentFilter": NotebookDocumentFilter, + "NotebookDocumentFilterNotebookType": NotebookDocumentFilterNotebookType, + "NotebookDocumentFilterPattern": NotebookDocumentFilterPattern, + "NotebookDocumentFilterScheme": NotebookDocumentFilterScheme, + "NotebookDocumentFilterWithCells": NotebookDocumentFilterWithCells, + "NotebookDocumentFilterWithNotebook": NotebookDocumentFilterWithNotebook, + "NotebookDocumentIdentifier": NotebookDocumentIdentifier, + "NotebookDocumentSyncClientCapabilities": NotebookDocumentSyncClientCapabilities, + "NotebookDocumentSyncOptions": NotebookDocumentSyncOptions, + "NotebookDocumentSyncRegistrationOptions": NotebookDocumentSyncRegistrationOptions, + "OptionalVersionedTextDocumentIdentifier": OptionalVersionedTextDocumentIdentifier, + "ParameterInformation": ParameterInformation, + "PartialResultParams": PartialResultParams, + "Pattern": Pattern, + "Position": Position, + "PositionEncodingKind": PositionEncodingKind, + "PrepareRenameDefaultBehavior": PrepareRenameDefaultBehavior, + "PrepareRenameParams": PrepareRenameParams, + "PrepareRenamePlaceholder": PrepareRenamePlaceholder, + "PrepareRenameResult": PrepareRenameResult, + "PrepareSupportDefaultBehavior": PrepareSupportDefaultBehavior, + "PreviousResultId": PreviousResultId, + "ProgressNotification": ProgressNotification, + "ProgressParams": ProgressParams, + "ProgressToken": ProgressToken, + "PublishDiagnosticsClientCapabilities": PublishDiagnosticsClientCapabilities, + "PublishDiagnosticsParams": PublishDiagnosticsParams, + "Range": Range, + "ReferenceClientCapabilities": ReferenceClientCapabilities, + "ReferenceContext": ReferenceContext, + "ReferenceOptions": ReferenceOptions, + "ReferenceParams": ReferenceParams, + "ReferenceRegistrationOptions": ReferenceRegistrationOptions, + "Registration": Registration, + "RegistrationParams": RegistrationParams, + "RegularExpressionsClientCapabilities": RegularExpressionsClientCapabilities, + "RelatedFullDocumentDiagnosticReport": RelatedFullDocumentDiagnosticReport, + "RelatedUnchangedDocumentDiagnosticReport": RelatedUnchangedDocumentDiagnosticReport, + "RelativePattern": RelativePattern, + "RenameClientCapabilities": RenameClientCapabilities, + "RenameFile": RenameFile, + "RenameFileOptions": RenameFileOptions, + "RenameFilesParams": RenameFilesParams, + "RenameOptions": RenameOptions, + "RenameParams": RenameParams, + "RenameRegistrationOptions": RenameRegistrationOptions, + "ResourceOperation": ResourceOperation, + "ResourceOperationKind": ResourceOperationKind, + "ResponseError": ResponseError, + "ResponseErrorMessage": ResponseErrorMessage, + "SaveOptions": SaveOptions, + "SelectedCompletionInfo": SelectedCompletionInfo, + "SelectionRange": SelectionRange, + "SelectionRangeClientCapabilities": SelectionRangeClientCapabilities, + "SelectionRangeOptions": SelectionRangeOptions, + "SelectionRangeParams": SelectionRangeParams, + "SelectionRangeRegistrationOptions": SelectionRangeRegistrationOptions, + "SemanticTokenModifiers": SemanticTokenModifiers, + "SemanticTokenTypes": SemanticTokenTypes, + "SemanticTokens": SemanticTokens, + "SemanticTokensClientCapabilities": SemanticTokensClientCapabilities, + "SemanticTokensDelta": SemanticTokensDelta, + "SemanticTokensDeltaParams": SemanticTokensDeltaParams, + "SemanticTokensDeltaPartialResult": SemanticTokensDeltaPartialResult, + "SemanticTokensEdit": SemanticTokensEdit, + "SemanticTokensFullDelta": SemanticTokensFullDelta, + "SemanticTokensLegend": SemanticTokensLegend, + "SemanticTokensOptions": SemanticTokensOptions, + "SemanticTokensParams": SemanticTokensParams, + "SemanticTokensPartialResult": SemanticTokensPartialResult, + "SemanticTokensRangeParams": SemanticTokensRangeParams, + "SemanticTokensRegistrationOptions": SemanticTokensRegistrationOptions, + "SemanticTokensWorkspaceClientCapabilities": SemanticTokensWorkspaceClientCapabilities, + "ServerCapabilities": ServerCapabilities, + "ServerCompletionItemOptions": ServerCompletionItemOptions, + "ServerInfo": ServerInfo, + "SetTraceNotification": SetTraceNotification, + "SetTraceParams": SetTraceParams, + "ShowDocumentClientCapabilities": ShowDocumentClientCapabilities, + "ShowDocumentParams": ShowDocumentParams, + "ShowDocumentResult": ShowDocumentResult, + "ShowMessageParams": ShowMessageParams, + "ShowMessageRequestClientCapabilities": ShowMessageRequestClientCapabilities, + "ShowMessageRequestParams": ShowMessageRequestParams, + "ShutdownRequest": ShutdownRequest, + "ShutdownResponse": ShutdownResponse, + "SignatureHelp": SignatureHelp, + "SignatureHelpClientCapabilities": SignatureHelpClientCapabilities, + "SignatureHelpContext": SignatureHelpContext, + "SignatureHelpOptions": SignatureHelpOptions, + "SignatureHelpParams": SignatureHelpParams, + "SignatureHelpRegistrationOptions": SignatureHelpRegistrationOptions, + "SignatureHelpTriggerKind": SignatureHelpTriggerKind, + "SignatureInformation": SignatureInformation, + "StaleRequestSupportOptions": StaleRequestSupportOptions, + "StaticRegistrationOptions": StaticRegistrationOptions, + "StringValue": StringValue, + "SymbolInformation": SymbolInformation, + "SymbolKind": SymbolKind, + "SymbolTag": SymbolTag, + "TelemetryEventNotification": TelemetryEventNotification, + "TextDocumentChangeRegistrationOptions": TextDocumentChangeRegistrationOptions, + "TextDocumentClientCapabilities": TextDocumentClientCapabilities, + "TextDocumentCodeActionRequest": TextDocumentCodeActionRequest, + "TextDocumentCodeActionResponse": TextDocumentCodeActionResponse, + "TextDocumentCodeLensRequest": TextDocumentCodeLensRequest, + "TextDocumentCodeLensResponse": TextDocumentCodeLensResponse, + "TextDocumentColorPresentationOptions": TextDocumentColorPresentationOptions, + "TextDocumentColorPresentationRequest": TextDocumentColorPresentationRequest, + "TextDocumentColorPresentationResponse": TextDocumentColorPresentationResponse, + "TextDocumentCompletionRequest": TextDocumentCompletionRequest, + "TextDocumentCompletionResponse": TextDocumentCompletionResponse, + "TextDocumentContentChangeEvent": TextDocumentContentChangeEvent, + "TextDocumentContentChangePartial": TextDocumentContentChangePartial, + "TextDocumentContentChangeWholeDocument": TextDocumentContentChangeWholeDocument, + "TextDocumentDeclarationRequest": TextDocumentDeclarationRequest, + "TextDocumentDeclarationResponse": TextDocumentDeclarationResponse, + "TextDocumentDefinitionRequest": TextDocumentDefinitionRequest, + "TextDocumentDefinitionResponse": TextDocumentDefinitionResponse, + "TextDocumentDiagnosticRequest": TextDocumentDiagnosticRequest, + "TextDocumentDiagnosticResponse": TextDocumentDiagnosticResponse, + "TextDocumentDidChangeNotification": TextDocumentDidChangeNotification, + "TextDocumentDidCloseNotification": TextDocumentDidCloseNotification, + "TextDocumentDidOpenNotification": TextDocumentDidOpenNotification, + "TextDocumentDidSaveNotification": TextDocumentDidSaveNotification, + "TextDocumentDocumentColorRequest": TextDocumentDocumentColorRequest, + "TextDocumentDocumentColorResponse": TextDocumentDocumentColorResponse, + "TextDocumentDocumentHighlightRequest": TextDocumentDocumentHighlightRequest, + "TextDocumentDocumentHighlightResponse": TextDocumentDocumentHighlightResponse, + "TextDocumentDocumentLinkRequest": TextDocumentDocumentLinkRequest, + "TextDocumentDocumentLinkResponse": TextDocumentDocumentLinkResponse, + "TextDocumentDocumentSymbolRequest": TextDocumentDocumentSymbolRequest, + "TextDocumentDocumentSymbolResponse": TextDocumentDocumentSymbolResponse, + "TextDocumentEdit": TextDocumentEdit, + "TextDocumentFilter": TextDocumentFilter, + "TextDocumentFilterLanguage": TextDocumentFilterLanguage, + "TextDocumentFilterPattern": TextDocumentFilterPattern, + "TextDocumentFilterScheme": TextDocumentFilterScheme, + "TextDocumentFoldingRangeRequest": TextDocumentFoldingRangeRequest, + "TextDocumentFoldingRangeResponse": TextDocumentFoldingRangeResponse, + "TextDocumentFormattingRequest": TextDocumentFormattingRequest, + "TextDocumentFormattingResponse": TextDocumentFormattingResponse, + "TextDocumentHoverRequest": TextDocumentHoverRequest, + "TextDocumentHoverResponse": TextDocumentHoverResponse, + "TextDocumentIdentifier": TextDocumentIdentifier, + "TextDocumentImplementationRequest": TextDocumentImplementationRequest, + "TextDocumentImplementationResponse": TextDocumentImplementationResponse, + "TextDocumentInlayHintRequest": TextDocumentInlayHintRequest, + "TextDocumentInlayHintResponse": TextDocumentInlayHintResponse, + "TextDocumentInlineCompletionRequest": TextDocumentInlineCompletionRequest, + "TextDocumentInlineCompletionResponse": TextDocumentInlineCompletionResponse, + "TextDocumentInlineValueRequest": TextDocumentInlineValueRequest, + "TextDocumentInlineValueResponse": TextDocumentInlineValueResponse, + "TextDocumentItem": TextDocumentItem, + "TextDocumentLinkedEditingRangeRequest": TextDocumentLinkedEditingRangeRequest, + "TextDocumentLinkedEditingRangeResponse": TextDocumentLinkedEditingRangeResponse, + "TextDocumentMonikerRequest": TextDocumentMonikerRequest, + "TextDocumentMonikerResponse": TextDocumentMonikerResponse, + "TextDocumentOnTypeFormattingRequest": TextDocumentOnTypeFormattingRequest, + "TextDocumentOnTypeFormattingResponse": TextDocumentOnTypeFormattingResponse, + "TextDocumentPositionParams": TextDocumentPositionParams, + "TextDocumentPrepareCallHierarchyRequest": TextDocumentPrepareCallHierarchyRequest, + "TextDocumentPrepareCallHierarchyResponse": TextDocumentPrepareCallHierarchyResponse, + "TextDocumentPrepareRenameRequest": TextDocumentPrepareRenameRequest, + "TextDocumentPrepareRenameResponse": TextDocumentPrepareRenameResponse, + "TextDocumentPrepareTypeHierarchyRequest": TextDocumentPrepareTypeHierarchyRequest, + "TextDocumentPrepareTypeHierarchyResponse": TextDocumentPrepareTypeHierarchyResponse, + "TextDocumentPublishDiagnosticsNotification": TextDocumentPublishDiagnosticsNotification, + "TextDocumentRangeFormattingRequest": TextDocumentRangeFormattingRequest, + "TextDocumentRangeFormattingResponse": TextDocumentRangeFormattingResponse, + "TextDocumentRangesFormattingRequest": TextDocumentRangesFormattingRequest, + "TextDocumentRangesFormattingResponse": TextDocumentRangesFormattingResponse, + "TextDocumentReferencesRequest": TextDocumentReferencesRequest, + "TextDocumentReferencesResponse": TextDocumentReferencesResponse, + "TextDocumentRegistrationOptions": TextDocumentRegistrationOptions, + "TextDocumentRenameRequest": TextDocumentRenameRequest, + "TextDocumentRenameResponse": TextDocumentRenameResponse, + "TextDocumentSaveReason": TextDocumentSaveReason, + "TextDocumentSaveRegistrationOptions": TextDocumentSaveRegistrationOptions, + "TextDocumentSelectionRangeRequest": TextDocumentSelectionRangeRequest, + "TextDocumentSelectionRangeResponse": TextDocumentSelectionRangeResponse, + "TextDocumentSemanticTokensFullDeltaRequest": TextDocumentSemanticTokensFullDeltaRequest, + "TextDocumentSemanticTokensFullDeltaResponse": TextDocumentSemanticTokensFullDeltaResponse, + "TextDocumentSemanticTokensFullRequest": TextDocumentSemanticTokensFullRequest, + "TextDocumentSemanticTokensFullResponse": TextDocumentSemanticTokensFullResponse, + "TextDocumentSemanticTokensRangeRequest": TextDocumentSemanticTokensRangeRequest, + "TextDocumentSemanticTokensRangeResponse": TextDocumentSemanticTokensRangeResponse, + "TextDocumentSignatureHelpRequest": TextDocumentSignatureHelpRequest, + "TextDocumentSignatureHelpResponse": TextDocumentSignatureHelpResponse, + "TextDocumentSyncClientCapabilities": TextDocumentSyncClientCapabilities, + "TextDocumentSyncKind": TextDocumentSyncKind, + "TextDocumentSyncOptions": TextDocumentSyncOptions, + "TextDocumentTypeDefinitionRequest": TextDocumentTypeDefinitionRequest, + "TextDocumentTypeDefinitionResponse": TextDocumentTypeDefinitionResponse, + "TextDocumentWillSaveNotification": TextDocumentWillSaveNotification, + "TextDocumentWillSaveWaitUntilRequest": TextDocumentWillSaveWaitUntilRequest, + "TextDocumentWillSaveWaitUntilResponse": TextDocumentWillSaveWaitUntilResponse, + "TextEdit": TextEdit, + "TokenFormat": TokenFormat, + "TraceValues": TraceValues, + "TypeDefinitionClientCapabilities": TypeDefinitionClientCapabilities, + "TypeDefinitionOptions": TypeDefinitionOptions, + "TypeDefinitionParams": TypeDefinitionParams, + "TypeDefinitionRegistrationOptions": TypeDefinitionRegistrationOptions, + "TypeHierarchyClientCapabilities": TypeHierarchyClientCapabilities, + "TypeHierarchyItem": TypeHierarchyItem, + "TypeHierarchyOptions": TypeHierarchyOptions, + "TypeHierarchyPrepareParams": TypeHierarchyPrepareParams, + "TypeHierarchyRegistrationOptions": TypeHierarchyRegistrationOptions, + "TypeHierarchySubtypesParams": TypeHierarchySubtypesParams, + "TypeHierarchySubtypesRequest": TypeHierarchySubtypesRequest, + "TypeHierarchySubtypesResponse": TypeHierarchySubtypesResponse, + "TypeHierarchySupertypesParams": TypeHierarchySupertypesParams, + "TypeHierarchySupertypesRequest": TypeHierarchySupertypesRequest, + "TypeHierarchySupertypesResponse": TypeHierarchySupertypesResponse, + "UnchangedDocumentDiagnosticReport": UnchangedDocumentDiagnosticReport, + "UniquenessLevel": UniquenessLevel, + "Unregistration": Unregistration, + "UnregistrationParams": UnregistrationParams, + "VersionedNotebookDocumentIdentifier": VersionedNotebookDocumentIdentifier, + "VersionedTextDocumentIdentifier": VersionedTextDocumentIdentifier, + "WatchKind": WatchKind, + "WillSaveTextDocumentParams": WillSaveTextDocumentParams, + "WindowClientCapabilities": WindowClientCapabilities, + "WindowLogMessageNotification": WindowLogMessageNotification, + "WindowShowDocumentRequest": WindowShowDocumentRequest, + "WindowShowDocumentResponse": WindowShowDocumentResponse, + "WindowShowMessageNotification": WindowShowMessageNotification, + "WindowShowMessageRequestRequest": WindowShowMessageRequestRequest, + "WindowShowMessageRequestResponse": WindowShowMessageRequestResponse, + "WindowWorkDoneProgressCancelNotification": WindowWorkDoneProgressCancelNotification, + "WindowWorkDoneProgressCreateRequest": WindowWorkDoneProgressCreateRequest, + "WindowWorkDoneProgressCreateResponse": WindowWorkDoneProgressCreateResponse, + "WorkDoneProgressBegin": WorkDoneProgressBegin, + "WorkDoneProgressCancelParams": WorkDoneProgressCancelParams, + "WorkDoneProgressCreateParams": WorkDoneProgressCreateParams, + "WorkDoneProgressEnd": WorkDoneProgressEnd, + "WorkDoneProgressOptions": WorkDoneProgressOptions, + "WorkDoneProgressParams": WorkDoneProgressParams, + "WorkDoneProgressReport": WorkDoneProgressReport, + "WorkspaceApplyEditRequest": WorkspaceApplyEditRequest, + "WorkspaceApplyEditResponse": WorkspaceApplyEditResponse, + "WorkspaceClientCapabilities": WorkspaceClientCapabilities, + "WorkspaceCodeLensRefreshRequest": WorkspaceCodeLensRefreshRequest, + "WorkspaceCodeLensRefreshResponse": WorkspaceCodeLensRefreshResponse, + "WorkspaceConfigurationParams": WorkspaceConfigurationParams, + "WorkspaceConfigurationRequest": WorkspaceConfigurationRequest, + "WorkspaceConfigurationResponse": WorkspaceConfigurationResponse, + "WorkspaceDiagnosticParams": WorkspaceDiagnosticParams, + "WorkspaceDiagnosticRefreshRequest": WorkspaceDiagnosticRefreshRequest, + "WorkspaceDiagnosticRefreshResponse": WorkspaceDiagnosticRefreshResponse, + "WorkspaceDiagnosticReport": WorkspaceDiagnosticReport, + "WorkspaceDiagnosticReportPartialResult": WorkspaceDiagnosticReportPartialResult, + "WorkspaceDiagnosticRequest": WorkspaceDiagnosticRequest, + "WorkspaceDiagnosticResponse": WorkspaceDiagnosticResponse, + "WorkspaceDidChangeConfigurationNotification": WorkspaceDidChangeConfigurationNotification, + "WorkspaceDidChangeWatchedFilesNotification": WorkspaceDidChangeWatchedFilesNotification, + "WorkspaceDidChangeWorkspaceFoldersNotification": WorkspaceDidChangeWorkspaceFoldersNotification, + "WorkspaceDidCreateFilesNotification": WorkspaceDidCreateFilesNotification, + "WorkspaceDidDeleteFilesNotification": WorkspaceDidDeleteFilesNotification, + "WorkspaceDidRenameFilesNotification": WorkspaceDidRenameFilesNotification, + "WorkspaceDocumentDiagnosticReport": WorkspaceDocumentDiagnosticReport, + "WorkspaceEdit": WorkspaceEdit, + "WorkspaceEditClientCapabilities": WorkspaceEditClientCapabilities, + "WorkspaceExecuteCommandRequest": WorkspaceExecuteCommandRequest, + "WorkspaceExecuteCommandResponse": WorkspaceExecuteCommandResponse, + "WorkspaceFolder": WorkspaceFolder, + "WorkspaceFoldersChangeEvent": WorkspaceFoldersChangeEvent, + "WorkspaceFoldersInitializeParams": WorkspaceFoldersInitializeParams, + "WorkspaceFoldersServerCapabilities": WorkspaceFoldersServerCapabilities, + "WorkspaceFoldingRangeRefreshRequest": WorkspaceFoldingRangeRefreshRequest, + "WorkspaceFoldingRangeRefreshResponse": WorkspaceFoldingRangeRefreshResponse, + "WorkspaceFullDocumentDiagnosticReport": WorkspaceFullDocumentDiagnosticReport, + "WorkspaceInlayHintRefreshRequest": WorkspaceInlayHintRefreshRequest, + "WorkspaceInlayHintRefreshResponse": WorkspaceInlayHintRefreshResponse, + "WorkspaceInlineValueRefreshRequest": WorkspaceInlineValueRefreshRequest, + "WorkspaceInlineValueRefreshResponse": WorkspaceInlineValueRefreshResponse, + "WorkspaceOptions": WorkspaceOptions, + "WorkspaceSemanticTokensRefreshRequest": WorkspaceSemanticTokensRefreshRequest, + "WorkspaceSemanticTokensRefreshResponse": WorkspaceSemanticTokensRefreshResponse, + "WorkspaceSymbol": WorkspaceSymbol, + "WorkspaceSymbolClientCapabilities": WorkspaceSymbolClientCapabilities, + "WorkspaceSymbolOptions": WorkspaceSymbolOptions, + "WorkspaceSymbolParams": WorkspaceSymbolParams, + "WorkspaceSymbolRegistrationOptions": WorkspaceSymbolRegistrationOptions, + "WorkspaceSymbolRequest": WorkspaceSymbolRequest, + "WorkspaceSymbolResolveRequest": WorkspaceSymbolResolveRequest, + "WorkspaceSymbolResolveResponse": WorkspaceSymbolResolveResponse, + "WorkspaceSymbolResponse": WorkspaceSymbolResponse, + "WorkspaceUnchangedDocumentDiagnosticReport": WorkspaceUnchangedDocumentDiagnosticReport, + "WorkspaceWillCreateFilesRequest": WorkspaceWillCreateFilesRequest, + "WorkspaceWillCreateFilesResponse": WorkspaceWillCreateFilesResponse, + "WorkspaceWillDeleteFilesRequest": WorkspaceWillDeleteFilesRequest, + "WorkspaceWillDeleteFilesResponse": WorkspaceWillDeleteFilesResponse, + "WorkspaceWillRenameFilesRequest": WorkspaceWillRenameFilesRequest, + "WorkspaceWillRenameFilesResponse": WorkspaceWillRenameFilesResponse, + "WorkspaceWorkspaceFoldersRequest": WorkspaceWorkspaceFoldersRequest, + "WorkspaceWorkspaceFoldersResponse": WorkspaceWorkspaceFoldersResponse, + "_InitializeParams": _InitializeParams, +} + +_MESSAGE_DIRECTION: Dict[str, str] = { + # Request methods + CALL_HIERARCHY_INCOMING_CALLS: "clientToServer", + CALL_HIERARCHY_OUTGOING_CALLS: "clientToServer", + CLIENT_REGISTER_CAPABILITY: "serverToClient", + CLIENT_UNREGISTER_CAPABILITY: "serverToClient", + CODE_ACTION_RESOLVE: "clientToServer", + CODE_LENS_RESOLVE: "clientToServer", + COMPLETION_ITEM_RESOLVE: "clientToServer", + DOCUMENT_LINK_RESOLVE: "clientToServer", + INITIALIZE: "clientToServer", + INLAY_HINT_RESOLVE: "clientToServer", + SHUTDOWN: "clientToServer", + TEXT_DOCUMENT_CODE_ACTION: "clientToServer", + TEXT_DOCUMENT_CODE_LENS: "clientToServer", + TEXT_DOCUMENT_COLOR_PRESENTATION: "clientToServer", + TEXT_DOCUMENT_COMPLETION: "clientToServer", + TEXT_DOCUMENT_DECLARATION: "clientToServer", + TEXT_DOCUMENT_DEFINITION: "clientToServer", + TEXT_DOCUMENT_DIAGNOSTIC: "clientToServer", + TEXT_DOCUMENT_DOCUMENT_COLOR: "clientToServer", + TEXT_DOCUMENT_DOCUMENT_HIGHLIGHT: "clientToServer", + TEXT_DOCUMENT_DOCUMENT_LINK: "clientToServer", + TEXT_DOCUMENT_DOCUMENT_SYMBOL: "clientToServer", + TEXT_DOCUMENT_FOLDING_RANGE: "clientToServer", + TEXT_DOCUMENT_FORMATTING: "clientToServer", + TEXT_DOCUMENT_HOVER: "clientToServer", + TEXT_DOCUMENT_IMPLEMENTATION: "clientToServer", + TEXT_DOCUMENT_INLAY_HINT: "clientToServer", + TEXT_DOCUMENT_INLINE_COMPLETION: "clientToServer", + TEXT_DOCUMENT_INLINE_VALUE: "clientToServer", + TEXT_DOCUMENT_LINKED_EDITING_RANGE: "clientToServer", + TEXT_DOCUMENT_MONIKER: "clientToServer", + TEXT_DOCUMENT_ON_TYPE_FORMATTING: "clientToServer", + TEXT_DOCUMENT_PREPARE_CALL_HIERARCHY: "clientToServer", + TEXT_DOCUMENT_PREPARE_RENAME: "clientToServer", + TEXT_DOCUMENT_PREPARE_TYPE_HIERARCHY: "clientToServer", + TEXT_DOCUMENT_RANGES_FORMATTING: "clientToServer", + TEXT_DOCUMENT_RANGE_FORMATTING: "clientToServer", + TEXT_DOCUMENT_REFERENCES: "clientToServer", + TEXT_DOCUMENT_RENAME: "clientToServer", + TEXT_DOCUMENT_SELECTION_RANGE: "clientToServer", + TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL: "clientToServer", + TEXT_DOCUMENT_SEMANTIC_TOKENS_FULL_DELTA: "clientToServer", + TEXT_DOCUMENT_SEMANTIC_TOKENS_RANGE: "clientToServer", + TEXT_DOCUMENT_SIGNATURE_HELP: "clientToServer", + TEXT_DOCUMENT_TYPE_DEFINITION: "clientToServer", + TEXT_DOCUMENT_WILL_SAVE_WAIT_UNTIL: "clientToServer", + TYPE_HIERARCHY_SUBTYPES: "clientToServer", + TYPE_HIERARCHY_SUPERTYPES: "clientToServer", + WINDOW_SHOW_DOCUMENT: "serverToClient", + WINDOW_SHOW_MESSAGE_REQUEST: "serverToClient", + WINDOW_WORK_DONE_PROGRESS_CREATE: "serverToClient", + WORKSPACE_APPLY_EDIT: "serverToClient", + WORKSPACE_CODE_LENS_REFRESH: "serverToClient", + WORKSPACE_CONFIGURATION: "serverToClient", + WORKSPACE_DIAGNOSTIC: "clientToServer", + WORKSPACE_DIAGNOSTIC_REFRESH: "serverToClient", + WORKSPACE_EXECUTE_COMMAND: "clientToServer", + WORKSPACE_FOLDING_RANGE_REFRESH: "serverToClient", + WORKSPACE_INLAY_HINT_REFRESH: "serverToClient", + WORKSPACE_INLINE_VALUE_REFRESH: "serverToClient", + WORKSPACE_SEMANTIC_TOKENS_REFRESH: "serverToClient", + WORKSPACE_SYMBOL: "clientToServer", + WORKSPACE_SYMBOL_RESOLVE: "clientToServer", + WORKSPACE_WILL_CREATE_FILES: "clientToServer", + WORKSPACE_WILL_DELETE_FILES: "clientToServer", + WORKSPACE_WILL_RENAME_FILES: "clientToServer", + WORKSPACE_WORKSPACE_FOLDERS: "serverToClient", + # Notification methods + CANCEL_REQUEST: "both", + EXIT: "clientToServer", + INITIALIZED: "clientToServer", + LOG_TRACE: "serverToClient", + NOTEBOOK_DOCUMENT_DID_CHANGE: "clientToServer", + NOTEBOOK_DOCUMENT_DID_CLOSE: "clientToServer", + NOTEBOOK_DOCUMENT_DID_OPEN: "clientToServer", + NOTEBOOK_DOCUMENT_DID_SAVE: "clientToServer", + PROGRESS: "both", + SET_TRACE: "clientToServer", + TELEMETRY_EVENT: "serverToClient", + TEXT_DOCUMENT_DID_CHANGE: "clientToServer", + TEXT_DOCUMENT_DID_CLOSE: "clientToServer", + TEXT_DOCUMENT_DID_OPEN: "clientToServer", + TEXT_DOCUMENT_DID_SAVE: "clientToServer", + TEXT_DOCUMENT_PUBLISH_DIAGNOSTICS: "serverToClient", + TEXT_DOCUMENT_WILL_SAVE: "clientToServer", + WINDOW_LOG_MESSAGE: "serverToClient", + WINDOW_SHOW_MESSAGE: "serverToClient", + WINDOW_WORK_DONE_PROGRESS_CANCEL: "clientToServer", + WORKSPACE_DID_CHANGE_CONFIGURATION: "clientToServer", + WORKSPACE_DID_CHANGE_WATCHED_FILES: "clientToServer", + WORKSPACE_DID_CHANGE_WORKSPACE_FOLDERS: "clientToServer", + WORKSPACE_DID_CREATE_FILES: "clientToServer", + WORKSPACE_DID_DELETE_FILES: "clientToServer", + WORKSPACE_DID_RENAME_FILES: "clientToServer", +} + + +def message_direction(method: str) -> str: + """Returns message direction clientToServer, serverToClient or both.""" + return _MESSAGE_DIRECTION[method] From db52d1535311aeb701d1b6cbc12c6cac0f7817b0 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 19:13:29 -0800 Subject: [PATCH 21/27] Fix hooks --- packages/python/lsprotocol/_hooks.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/python/lsprotocol/_hooks.py b/packages/python/lsprotocol/_hooks.py index 73efad5..71ffb7c 100644 --- a/packages/python/lsprotocol/_hooks.py +++ b/packages/python/lsprotocol/_hooks.py @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import sys -from typing import Any, List, Optional, Sequence, Tuple, Union +from typing import Any, Optional, Sequence, Tuple, Union import attrs import cattrs @@ -390,7 +390,7 @@ def _inlay_hint_provider_hook( def _inlay_hint_label_part_hook( object_: Any, _: type - ) -> Union[str, List[lsp_types.InlayHintLabelPart]]: + ) -> Union[str, Sequence[lsp_types.InlayHintLabelPart]]: if isinstance(object_, str): return object_ @@ -431,7 +431,7 @@ def _code_action_hook( def _completion_list_hook( object_: Any, _: type - ) -> Optional[Union[lsp_types.CompletionList, List[lsp_types.CompletionItem]]]: + ) -> Optional[Union[lsp_types.CompletionList, Sequence[lsp_types.CompletionItem]]]: if object_ is None: return None if isinstance(object_, list): @@ -446,8 +446,8 @@ def _location_hook( ) -> Optional[ Union[ lsp_types.Location, - List[lsp_types.Location], - List[lsp_types.LocationLink], + Sequence[lsp_types.Location], + Sequence[lsp_types.LocationLink], ] ]: if object_ is None: @@ -470,7 +470,7 @@ def _location_hook( def _symbol_hook( object_: Any, _: type ) -> Optional[ - Union[List[lsp_types.DocumentSymbol], List[lsp_types.SymbolInformation]] + Union[Sequence[lsp_types.DocumentSymbol], Sequence[lsp_types.SymbolInformation]] ]: if object_ is None: return None @@ -497,7 +497,7 @@ def _markup_content_hook( OptionalPrimitive, lsp_types.MarkupContent, lsp_types.MarkedStringWithLanguage, - List[Union[OptionalPrimitive, lsp_types.MarkedStringWithLanguage]], + Sequence[Union[OptionalPrimitive, lsp_types.MarkedStringWithLanguage]], ] ]: if object_ is None: @@ -656,7 +656,7 @@ def _inline_completion_provider_hook( def _inline_completion_list_hook( object_: Any, _: type ) -> Optional[ - Union[lsp_types.InlineCompletionList, List[lsp_types.InlineCompletionItem]] + Union[lsp_types.InlineCompletionList, Sequence[lsp_types.InlineCompletionItem]] ]: if object_ is None: return None @@ -679,7 +679,9 @@ def _string_value_hook( def _symbol_list_hook( object_: Any, _: type ) -> Optional[ - Union[List[lsp_types.SymbolInformation], List[lsp_types.WorkspaceSymbol]] + Union[ + Sequence[lsp_types.SymbolInformation], Sequence[lsp_types.WorkspaceSymbol] + ] ]: if object_ is None: return None @@ -934,7 +936,7 @@ def _notebook_sync_registration_option_selector_hook( lsp_types.MarkupContent, str, lsp_types.MarkedStringWithLanguage, - List[Union[str, lsp_types.MarkedStringWithLanguage]], + Sequence[Union[str, lsp_types.MarkedStringWithLanguage]], ], _markup_content_hook, ), From b809465a022aa40b2257a513a9b9870bf6cf2cde Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 19:22:38 -0800 Subject: [PATCH 22/27] Fix linting --- packages/python/lsprotocol/_hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/python/lsprotocol/_hooks.py b/packages/python/lsprotocol/_hooks.py index 71ffb7c..41a3beb 100644 --- a/packages/python/lsprotocol/_hooks.py +++ b/packages/python/lsprotocol/_hooks.py @@ -454,7 +454,7 @@ def _location_hook( return None if isinstance(object_, list): if len(object_) == 0: - return [] # type: ignore[return-value] + return [] if "targetUri" in object_[0]: return [ converter.structure(item, lsp_types.LocationLink) @@ -476,7 +476,7 @@ def _symbol_hook( return None if isinstance(object_, list): if len(object_) == 0: - return [] # type: ignore[return-value] + return [] if "location" in object_[0]: return [ converter.structure(item, lsp_types.SymbolInformation) @@ -687,7 +687,7 @@ def _symbol_list_hook( return None assert isinstance(object_, list) if len(object_) == 0: - return [] # type: ignore[return-value] + return [] if "location" in object_[0]: return [ converter.structure(item, lsp_types.SymbolInformation) From 9a73d0fdae53fbdc361076a062bbe7403e40a8d6 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 19:31:05 -0800 Subject: [PATCH 23/27] Use ruff linter --- conftest.py | 1 - generator/model.py | 2 +- generator/plugins/dotnet/__init__.py | 1 - generator/plugins/dotnet/dotnet_classes.py | 18 +++++++++--------- generator/plugins/dotnet/dotnet_enums.py | 2 +- generator/plugins/dotnet/dotnet_helpers.py | 2 +- .../plugins/dotnet/dotnet_special_classes.py | 2 +- generator/plugins/dotnet/dotnet_utils.py | 4 +--- generator/plugins/python/__init__.py | 1 - generator/plugins/python/utils.py | 4 ++-- generator/plugins/rust/__init__.py | 1 - generator/plugins/rust/rust_commons.py | 2 +- generator/plugins/testdata/__init__.py | 1 - .../plugins/testdata/testdata_generator.py | 4 ++-- generator/plugins/testdata/testdata_utils.py | 2 +- noxfile.py | 3 ++- tests/generator/test_model.py | 1 - tests/python/common/jsonrpc.py | 4 ++-- .../test_inlay_hint_resolve_request.py | 1 - tests/python/test_generated_data.py | 4 ++-- 20 files changed, 26 insertions(+), 34 deletions(-) diff --git a/conftest.py b/conftest.py index fada2fb..ad35f7e 100644 --- a/conftest.py +++ b/conftest.py @@ -5,7 +5,6 @@ import pathlib import sys -import pytest sys.path.append(os.fspath(pathlib.Path(__file__).parent / "packages" / "python")) sys.path.append( diff --git a/generator/model.py b/generator/model.py index abac69d..6bc8a0b 100644 --- a/generator/model.py +++ b/generator/model.py @@ -4,7 +4,7 @@ from __future__ import annotations import uuid -from typing import Any, Dict, Iterable, List, Optional, Type, TypeVar, Union +from typing import Any, Dict, Iterable, List, Optional, Type, Union import attrs diff --git a/generator/plugins/dotnet/__init__.py b/generator/plugins/dotnet/__init__.py index 8c6065b..b9d4a32 100644 --- a/generator/plugins/dotnet/__init__.py +++ b/generator/plugins/dotnet/__init__.py @@ -1,4 +1,3 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from .dotnet_utils import generate_from_spec as generate diff --git a/generator/plugins/dotnet/dotnet_classes.py b/generator/plugins/dotnet/dotnet_classes.py index 0a705cd..7a2abac 100644 --- a/generator/plugins/dotnet/dotnet_classes.py +++ b/generator/plugins/dotnet/dotnet_classes.py @@ -101,9 +101,9 @@ def get_type_name( enum_def = _get_enum(type_def.name, spec) if enum_def and enum_def.supportsCustomValues: if _is_str_enum(enum_def): - name = f"string" + name = "string" elif _is_int_enum(enum_def): - name = f"int" + name = "int" else: name = get_special_case_class_name(type_def.name) elif type_def.kind == "array": @@ -506,7 +506,7 @@ def generate_type_alias_converter( "{", "reader = reader ?? throw new ArgumentNullException(nameof(reader));", "if (reader.TokenType == JsonToken.Null) { return null; }", - f"var o = _orType.ReadJson(reader, objectType, existingValue, serializer);", + "var o = _orType.ReadJson(reader, objectType, existingValue, serializer);", f"if (o is {or_type} orType)", "{", ] @@ -631,7 +631,7 @@ def generate_code_for_variant_struct( sig = ", ".join(constructor_args) types.add_ctor(struct.name, ctor_data) ctor = [ - f"[JsonConstructor]", + "[JsonConstructor]", f"public {struct.name}({sig})", "{", *indent_lines( @@ -640,7 +640,7 @@ def generate_code_for_variant_struct( "{", *indent_lines( [ - f'throw new ArgumentException("At least one of the arguments must be non-null");' + 'throw new ArgumentException("At least one of the arguments must be non-null");' ] ), "}", @@ -880,7 +880,7 @@ def get_response_template( {"kind": "base", "name": "integer"}, ], }, - "documentation": f"The Request id.", + "documentation": "The Request id.", }, ] if obj.result: @@ -888,7 +888,7 @@ def get_response_template( { "name": "result", "type": cattrs.unstructure(obj.result), - "documentation": f"Results for the request.", + "documentation": "Results for the request.", "optional": True, } ) @@ -897,7 +897,7 @@ def get_response_template( { "name": "result", "type": {"kind": "base", "name": "null"}, - "documentation": f"Results for the request.", + "documentation": "Results for the request.", "optional": True, } ) @@ -905,7 +905,7 @@ def get_response_template( { "name": "error", "type": {"kind": "reference", "name": "ResponseError"}, - "documentation": f"Error while handling the request.", + "documentation": "Error while handling the request.", "optional": True, } ) diff --git a/generator/plugins/dotnet/dotnet_enums.py b/generator/plugins/dotnet/dotnet_enums.py index c5e7a6c..82c9d4c 100644 --- a/generator/plugins/dotnet/dotnet_enums.py +++ b/generator/plugins/dotnet/dotnet_enums.py @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from typing import Dict, List, Union +from typing import List, Union from generator import model diff --git a/generator/plugins/dotnet/dotnet_helpers.py b/generator/plugins/dotnet/dotnet_helpers.py index 2eb357a..7c9f046 100644 --- a/generator/plugins/dotnet/dotnet_helpers.py +++ b/generator/plugins/dotnet/dotnet_helpers.py @@ -176,7 +176,7 @@ def generate_extras( elif deprecated: extras += [f'[Obsolete("{cleanup_str(deprecated)}")]'] if type_def.proposed: - extras += [f"[Proposed]"] + extras += ["[Proposed]"] if type_def.since: extras += [f'[Since("{cleanup_str(type_def.since)}")]'] diff --git a/generator/plugins/dotnet/dotnet_special_classes.py b/generator/plugins/dotnet/dotnet_special_classes.py index a656b6d..1b8e597 100644 --- a/generator/plugins/dotnet/dotnet_special_classes.py +++ b/generator/plugins/dotnet/dotnet_special_classes.py @@ -151,7 +151,7 @@ def generate_special_class( type_def, inner, "IEnumerable", - [f"[JsonConverter(typeof(DocumentSelectorConverter))]"], + ["[JsonConverter(typeof(DocumentSelectorConverter))]"], ), ) diff --git a/generator/plugins/dotnet/dotnet_utils.py b/generator/plugins/dotnet/dotnet_utils.py index 1ac49a3..5353db0 100644 --- a/generator/plugins/dotnet/dotnet_utils.py +++ b/generator/plugins/dotnet/dotnet_utils.py @@ -2,10 +2,8 @@ # Licensed under the MIT License. import logging -import os import pathlib -import subprocess -from typing import Dict, List +from typing import Dict import generator.model as model diff --git a/generator/plugins/python/__init__.py b/generator/plugins/python/__init__.py index c5de3ef..b9d4a32 100644 --- a/generator/plugins/python/__init__.py +++ b/generator/plugins/python/__init__.py @@ -1,4 +1,3 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from .utils import generate_from_spec as generate diff --git a/generator/plugins/python/utils.py b/generator/plugins/python/utils.py index 757bf7e..d237039 100644 --- a/generator/plugins/python/utils.py +++ b/generator/plugins/python/utils.py @@ -686,7 +686,7 @@ def _add_structure( code_lines += [f"{indent}pass"] if methods: - code_lines += [f"{indent}{l}" for l in methods] + code_lines += [f"{indent}{method}" for method in methods] # Detect if the class has properties that might be keywords. self._add_type_code(class_name, code_lines) @@ -777,7 +777,7 @@ def _add_requests(self, lsp_mode: model.LSPModel) -> None: "ResponseError", [ "@attrs.define", - f"class ResponseError:", + "class ResponseError:", f"{indent}code: int = attrs.field(validator=validators.integer_validator)", f'{indent}"""A number indicating the error type that occurred."""', f"{indent}message: str = attrs.field(validator=attrs.validators.instance_of(str))", diff --git a/generator/plugins/rust/__init__.py b/generator/plugins/rust/__init__.py index cbc2c00..b9d4a32 100644 --- a/generator/plugins/rust/__init__.py +++ b/generator/plugins/rust/__init__.py @@ -1,4 +1,3 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from .rust_utils import generate_from_spec as generate diff --git a/generator/plugins/rust/rust_commons.py b/generator/plugins/rust/rust_commons.py index 9b2ec1a..75c59aa 100644 --- a/generator/plugins/rust/rust_commons.py +++ b/generator/plugins/rust/rust_commons.py @@ -570,7 +570,7 @@ def generate_property( prop_def.type, types, spec, prop_def.optional, prop_def.name ) optional = ( - [f'#[serde(skip_serializing_if = "Option::is_none")]'] + ['#[serde(skip_serializing_if = "Option::is_none")]'] if is_special_property(prop_def) and not prop_def.optional else [] ) diff --git a/generator/plugins/testdata/__init__.py b/generator/plugins/testdata/__init__.py index 35cc498..b9d4a32 100644 --- a/generator/plugins/testdata/__init__.py +++ b/generator/plugins/testdata/__init__.py @@ -1,4 +1,3 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -from .testdata_utils import generate_from_spec as generate diff --git a/generator/plugins/testdata/testdata_generator.py b/generator/plugins/testdata/testdata_generator.py index 6b90784..8eabadd 100644 --- a/generator/plugins/testdata/testdata_generator.py +++ b/generator/plugins/testdata/testdata_generator.py @@ -83,9 +83,9 @@ def extend(arr: List[Any], length: int) -> List[Any]: def extend_all(lists: List[List[Any]]) -> List[List[Any]]: - max_len = max(len(l) for l in lists) + max_len = max(len(part) for part in lists) max_len = min(1000, max_len) - return [extend(l, max_len) for l in lists] + return [extend(part, max_len) for part in lists] def has_null_base_type(items: List[model.LSP_TYPE_SPEC]) -> bool: diff --git a/generator/plugins/testdata/testdata_utils.py b/generator/plugins/testdata/testdata_utils.py index 67797a6..7702e16 100644 --- a/generator/plugins/testdata/testdata_utils.py +++ b/generator/plugins/testdata/testdata_utils.py @@ -3,7 +3,7 @@ import logging import pathlib -from typing import Dict, List +from typing import Dict import generator.model as model diff --git a/noxfile.py b/noxfile.py index d6804a4..e1021e5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -36,7 +36,8 @@ def lint(session: nox.Session): _install_requirements(session) session.log("Linting: generator and generated Python code.") - session.install("isort", "black", "mypy") + session.install("isort", "black", "mypy", "ruff") + session.run("ruff", "check", ".") session.run("isort", "--profile", "black", "--check", ".") session.run("black", "--check", ".") session.run("mypy", "--strict", "--no-incremental", "./packages/python/lsprotocol") diff --git a/tests/generator/test_model.py b/tests/generator/test_model.py index 50f2b6e..e9b4e56 100644 --- a/tests/generator/test_model.py +++ b/tests/generator/test_model.py @@ -17,7 +17,6 @@ def test_model_loading(): def test_model_loading_failure(): - root = pathlib.Path(__file__).parent.parent / "generator" json_model = json.loads((lsp_json_path).read_text(encoding="utf-8")) del json_model["structures"][0]["name"] diff --git a/tests/python/common/jsonrpc.py b/tests/python/common/jsonrpc.py index 79de35f..17f3da7 100644 --- a/tests/python/common/jsonrpc.py +++ b/tests/python/common/jsonrpc.py @@ -21,7 +21,7 @@ def to_json( if hasattr(obj, "result"): if method is None: - raise ValueError(f"`method` must not be None for response type objects.") + raise ValueError("`method` must not be None for response type objects.") obj_type = types.METHOD_TO_TYPES[method][1] elif hasattr(obj, "error"): obj_type = types.ResponseErrorMessage @@ -43,7 +43,7 @@ def from_json(json_str: str, method: str = None, converter=None) -> types.MESSAG if "result" in obj: if method is None: - raise ValueError(f"`method` must not be None for response type objects.") + raise ValueError("`method` must not be None for response type objects.") obj_type = types.METHOD_TO_TYPES[method][1] elif "error" in obj: obj_type = types.ResponseErrorMessage diff --git a/tests/python/requests/test_inlay_hint_resolve_request.py b/tests/python/requests/test_inlay_hint_resolve_request.py index 6dc9f42..5c3b486 100644 --- a/tests/python/requests/test_inlay_hint_resolve_request.py +++ b/tests/python/requests/test_inlay_hint_resolve_request.py @@ -7,7 +7,6 @@ import hamcrest import jsonrpc import pytest -from cattrs.errors import ClassValidationError ID = str(uuid.uuid4()) diff --git a/tests/python/test_generated_data.py b/tests/python/test_generated_data.py index 0ecee3c..45dbcb2 100644 --- a/tests/python/test_generated_data.py +++ b/tests/python/test_generated_data.py @@ -3,7 +3,7 @@ import json import pathlib -from typing import Generator, List, Union +from typing import List, Union import pytest @@ -30,5 +30,5 @@ def test_generated_data(json_file: str) -> None: try: converter.structure(data, lsp_type) assert result_type == "True", "Expected error, but succeeded structuring" - except Exception as e: + except Exception: assert result_type == "False", "Expected success, but failed structuring" From 7fd2c83917cdedddc35951984cfedac2f27c97ca Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 19:40:29 -0800 Subject: [PATCH 24/27] ruff formatting --- .vscode/extensions.json | 8 +------- .vscode/settings.json | 7 +++++-- generator/plugins/dotnet/dotnet_helpers.py | 2 +- generator/plugins/rust/rust_commons.py | 2 +- packages/python/lsprotocol/_hooks.py | 5 ++++- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index e6d1a11..2698453 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,3 @@ { - "recommendations": [ - "esbenp.prettier-vscode", - "ms-python.python", - "ms-python.vscode-pylance", - "ms-python.black-formatter", - "ms-python.isort" - ] + "recommendations": ["esbenp.prettier-vscode", "ms-python.python", "ms-python.vscode-pylance", "charliermarsh.ruff"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 7fb5928..2d177c6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,9 +12,12 @@ "source.organizeImports": true }, "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter" + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports.ruff": true + } }, - "isort.args": ["--profile", "black"], "python.testing.pytestArgs": ["tests"], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, diff --git a/generator/plugins/dotnet/dotnet_helpers.py b/generator/plugins/dotnet/dotnet_helpers.py index 7c9f046..d6a2dbf 100644 --- a/generator/plugins/dotnet/dotnet_helpers.py +++ b/generator/plugins/dotnet/dotnet_helpers.py @@ -167,7 +167,7 @@ def generate_extras( model.Structure, model.Request, model.Notification, - ] + ], ) -> List[str]: deprecated = get_deprecated(type_def.documentation) extras = [] diff --git a/generator/plugins/rust/rust_commons.py b/generator/plugins/rust/rust_commons.py index 75c59aa..d19f9cc 100644 --- a/generator/plugins/rust/rust_commons.py +++ b/generator/plugins/rust/rust_commons.py @@ -665,7 +665,7 @@ def generate_literal_struct_type( def generate_extras( type_def: Union[ model.Enum, model.EnumItem, model.Property, model.TypeAlias, model.Structure - ] + ], ) -> List[str]: extras = [] if type_def.deprecated: diff --git a/packages/python/lsprotocol/_hooks.py b/packages/python/lsprotocol/_hooks.py index 41a3beb..a421439 100644 --- a/packages/python/lsprotocol/_hooks.py +++ b/packages/python/lsprotocol/_hooks.py @@ -553,7 +553,10 @@ def _semantic_tokens_hook( def _semantic_tokens_capabilities_hook( object_: Any, _: type - ) -> Union[OptionalPrimitive, lsp_types.ClientSemanticTokensRequestFullDelta,]: + ) -> Union[ + OptionalPrimitive, + lsp_types.ClientSemanticTokensRequestFullDelta, + ]: if object_ is None: return None if isinstance(object_, (bool, int, str, float)): From 3c980f6a1dcffb0f2704848919b76f3b03ac0709 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 19:47:54 -0800 Subject: [PATCH 25/27] use ruff import sorting --- conftest.py | 1 - noxfile.py | 26 +++++---------------- tests/python/notifications/test_progress.py | 1 - tests/python/test_cattrs_special_cases.py | 1 - tests/python/test_custom_validators.py | 3 +-- tests/python/test_enums.py | 1 - tests/python/test_generated_data.py | 3 +-- tests/python/test_location.py | 1 - tests/python/test_position.py | 1 - tests/python/test_range.py | 1 - 10 files changed, 8 insertions(+), 31 deletions(-) diff --git a/conftest.py b/conftest.py index ad35f7e..2c0f6a0 100644 --- a/conftest.py +++ b/conftest.py @@ -5,7 +5,6 @@ import pathlib import sys - sys.path.append(os.fspath(pathlib.Path(__file__).parent / "packages" / "python")) sys.path.append( os.fspath(pathlib.Path(__file__).parent / "tests" / "python" / "common") diff --git a/noxfile.py b/noxfile.py index e1021e5..f94260a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -36,10 +36,10 @@ def lint(session: nox.Session): _install_requirements(session) session.log("Linting: generator and generated Python code.") - session.install("isort", "black", "mypy", "ruff") + session.install("mypy", "ruff") session.run("ruff", "check", ".") - session.run("isort", "--profile", "black", "--check", ".") - session.run("black", "--check", ".") + session.run("ruff", "check", "--select=I001", ".") + session.run("ruff", "format", "--check", ".") session.run("mypy", "--strict", "--no-incremental", "./packages/python/lsprotocol") session.log("Linting: generated Rust code.") @@ -54,24 +54,10 @@ def format(session: nox.Session): def _format_code(session: nox.Session): - session.install("isort", "black") + session.install("ruff") - session.run("isort", "--profile", "black", "noxfile.py") - session.run("black", "noxfile.py") - - session.run("isort", "--profile", "black", "generator") - session.run("black", "generator") - - session.run("isort", "--profile", "black", "tests/generator") - session.run("black", "tests/generator") - - session.run("isort", "--profile", "black", "tests/python") - session.run("black", "tests/python") - - # this is for the lsprotocol package only - python_package_path = os.fspath(pathlib.Path("./packages/python/lsprotocol")) - session.run("isort", "--profile", "black", python_package_path) - session.run("black", python_package_path) + session.run("ruff", "check", "--fix", "--select=I001", ".") + session.run("ruff", "format", ".") @nox.session() diff --git a/tests/python/notifications/test_progress.py b/tests/python/notifications/test_progress.py index 3f7e918..b55e36d 100644 --- a/tests/python/notifications/test_progress.py +++ b/tests/python/notifications/test_progress.py @@ -6,7 +6,6 @@ import hamcrest import jsonrpc import pytest - from lsprotocol.types import ( ProgressNotification, ProgressParams, diff --git a/tests/python/test_cattrs_special_cases.py b/tests/python/test_cattrs_special_cases.py index c5e0e9c..cd4512c 100644 --- a/tests/python/test_cattrs_special_cases.py +++ b/tests/python/test_cattrs_special_cases.py @@ -7,7 +7,6 @@ import hamcrest import pytest from cattrs.errors import ClassValidationError - from lsprotocol import converters as cv from lsprotocol import types as lsp diff --git a/tests/python/test_custom_validators.py b/tests/python/test_custom_validators.py index c7fe1bd..b28333d 100644 --- a/tests/python/test_custom_validators.py +++ b/tests/python/test_custom_validators.py @@ -1,10 +1,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -import pytest - import lsprotocol.types as lsp import lsprotocol.validators as v +import pytest @pytest.mark.parametrize( diff --git a/tests/python/test_enums.py b/tests/python/test_enums.py index 3db64c1..de97827 100644 --- a/tests/python/test_enums.py +++ b/tests/python/test_enums.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp diff --git a/tests/python/test_generated_data.py b/tests/python/test_generated_data.py index 45dbcb2..46a3043 100644 --- a/tests/python/test_generated_data.py +++ b/tests/python/test_generated_data.py @@ -5,10 +5,9 @@ import pathlib from typing import List, Union -import pytest - import lsprotocol.converters as cv import lsprotocol.types as lsp +import pytest TEST_DATA_ROOT = pathlib.Path(__file__).parent.parent.parent / "packages" / "testdata" diff --git a/tests/python/test_location.py b/tests/python/test_location.py index 1a8cd8f..e65eb3e 100644 --- a/tests/python/test_location.py +++ b/tests/python/test_location.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp diff --git a/tests/python/test_position.py b/tests/python/test_position.py index 67bff8b..c149579 100644 --- a/tests/python/test_position.py +++ b/tests/python/test_position.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp diff --git a/tests/python/test_range.py b/tests/python/test_range.py index 9977e95..0a5801b 100644 --- a/tests/python/test_range.py +++ b/tests/python/test_range.py @@ -3,7 +3,6 @@ import hamcrest import pytest - from lsprotocol import types as lsp From 640aa1018b42cc0643bd52b1105aaed09723b741 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 19:52:38 -0800 Subject: [PATCH 26/27] cosmetic fixes --- noxfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index f94260a..01fbd4a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,7 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import json -import os import pathlib import urllib.request as url_lib @@ -50,6 +49,7 @@ def lint(session: nox.Session): @nox.session() def format(session: nox.Session): """Format generator and lsprotocol package for PyPI.""" + _install_requirements(session) _format_code(session) @@ -58,6 +58,7 @@ def _format_code(session: nox.Session): session.run("ruff", "check", "--fix", "--select=I001", ".") session.run("ruff", "format", ".") + session.run("ruff", "check", "--fix", ".") @nox.session() From b3f460aad098e1fef4e6321e64017b7cab9ba1ec Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Thu, 9 Nov 2023 23:13:06 -0800 Subject: [PATCH 27/27] Fix accidental fix --- generator/plugins/dotnet/__init__.py | 1 + generator/plugins/python/__init__.py | 1 + generator/plugins/rust/__init__.py | 1 + generator/plugins/testdata/__init__.py | 1 + 4 files changed, 4 insertions(+) diff --git a/generator/plugins/dotnet/__init__.py b/generator/plugins/dotnet/__init__.py index b9d4a32..acf67ec 100644 --- a/generator/plugins/dotnet/__init__.py +++ b/generator/plugins/dotnet/__init__.py @@ -1,3 +1,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from .dotnet_utils import generate_from_spec as generate # noqa: F401 diff --git a/generator/plugins/python/__init__.py b/generator/plugins/python/__init__.py index b9d4a32..dde96d1 100644 --- a/generator/plugins/python/__init__.py +++ b/generator/plugins/python/__init__.py @@ -1,3 +1,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from .utils import generate_from_spec as generate # noqa: F401 diff --git a/generator/plugins/rust/__init__.py b/generator/plugins/rust/__init__.py index b9d4a32..a07db09 100644 --- a/generator/plugins/rust/__init__.py +++ b/generator/plugins/rust/__init__.py @@ -1,3 +1,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from .rust_utils import generate_from_spec as generate # noqa: F401 diff --git a/generator/plugins/testdata/__init__.py b/generator/plugins/testdata/__init__.py index b9d4a32..43283cc 100644 --- a/generator/plugins/testdata/__init__.py +++ b/generator/plugins/testdata/__init__.py @@ -1,3 +1,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. +from .testdata_utils import generate_from_spec as generate # noqa: F401