diff options
-rw-r--r-- | Cargo.lock | 6 | ||||
-rw-r--r-- | crates/ra_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/caps.rs | 11 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/req.rs | 27 |
4 files changed, 13 insertions, 33 deletions
diff --git a/Cargo.lock b/Cargo.lock index 3f2cbc8ab..c29ce324e 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -620,7 +620,7 @@ dependencies = [ | |||
620 | 620 | ||
621 | [[package]] | 621 | [[package]] |
622 | name = "lsp-types" | 622 | name = "lsp-types" |
623 | version = "0.63.1" | 623 | version = "0.65.0" |
624 | source = "registry+https://github.com/rust-lang/crates.io-index" | 624 | source = "registry+https://github.com/rust-lang/crates.io-index" |
625 | dependencies = [ | 625 | dependencies = [ |
626 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | 626 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1049,7 +1049,7 @@ dependencies = [ | |||
1049 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1049 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1050 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1050 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
1051 | "lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1051 | "lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1052 | "lsp-types 0.63.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1052 | "lsp-types 0.65.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1053 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1053 | "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1054 | "ra_ide 0.1.0", | 1054 | "ra_ide 0.1.0", |
1055 | "ra_prof 0.1.0", | 1055 | "ra_prof 0.1.0", |
@@ -1841,7 +1841,7 @@ dependencies = [ | |||
1841 | "checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" | 1841 | "checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" |
1842 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" | 1842 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" |
1843 | "checksum lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ba36405bd742139ab79c246ca5adb7fde2fe1a0f495e2c8e2f607b607dedb12" | 1843 | "checksum lsp-server 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ba36405bd742139ab79c246ca5adb7fde2fe1a0f495e2c8e2f607b607dedb12" |
1844 | "checksum lsp-types 0.63.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70090cea3cd5db0aa923575e03874b33da90c4d0fe1eaf63fa51b8925a78ef03" | 1844 | "checksum lsp-types 0.65.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fe9e427e63e6172699737b47f1044bcade7046e2404d59ebd90c459da47cd2b" |
1845 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" | 1845 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" |
1846 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" | 1846 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" |
1847 | "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" | 1847 | "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" |
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index e29b688fd..e826c10ef 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml | |||
@@ -14,7 +14,7 @@ serde_json = "1.0.34" | |||
14 | serde = { version = "1.0.83", features = ["derive"] } | 14 | serde = { version = "1.0.83", features = ["derive"] } |
15 | crossbeam-channel = "0.4" | 15 | crossbeam-channel = "0.4" |
16 | log = "0.4.3" | 16 | log = "0.4.3" |
17 | lsp-types = { version = "0.63.1", features = ["proposed"] } | 17 | lsp-types = { version = "0.65.0", features = ["proposed"] } |
18 | rustc-hash = "1.0" | 18 | rustc-hash = "1.0" |
19 | parking_lot = "0.10.0" | 19 | parking_lot = "0.10.0" |
20 | jod-thread = "0.1.0" | 20 | jod-thread = "0.1.0" |
diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs index e0bb75666..d812ff7ca 100644 --- a/crates/ra_lsp_server/src/caps.rs +++ b/crates/ra_lsp_server/src/caps.rs | |||
@@ -2,10 +2,11 @@ | |||
2 | 2 | ||
3 | use lsp_types::{ | 3 | use lsp_types::{ |
4 | CodeActionProviderCapability, CodeLensOptions, CompletionOptions, | 4 | CodeActionProviderCapability, CodeLensOptions, CompletionOptions, |
5 | DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability, | 5 | DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, |
6 | ImplementationProviderCapability, RenameOptions, RenameProviderCapability, ServerCapabilities, | 6 | ImplementationProviderCapability, RenameOptions, RenameProviderCapability, |
7 | SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind, | 7 | SelectionRangeProviderCapability, ServerCapabilities, SignatureHelpOptions, |
8 | TextDocumentSyncOptions, TypeDefinitionProviderCapability, WorkDoneProgressOptions, | 8 | TextDocumentSyncCapability, TextDocumentSyncKind, TextDocumentSyncOptions, |
9 | TypeDefinitionProviderCapability, WorkDoneProgressOptions, | ||
9 | }; | 10 | }; |
10 | 11 | ||
11 | pub fn server_capabilities() -> ServerCapabilities { | 12 | pub fn server_capabilities() -> ServerCapabilities { |
@@ -44,7 +45,7 @@ pub fn server_capabilities() -> ServerCapabilities { | |||
44 | first_trigger_character: "=".to_string(), | 45 | first_trigger_character: "=".to_string(), |
45 | more_trigger_character: Some(vec![".".to_string(), ">".to_string()]), | 46 | more_trigger_character: Some(vec![".".to_string(), ">".to_string()]), |
46 | }), | 47 | }), |
47 | selection_range_provider: Some(GenericCapability::default()), | 48 | selection_range_provider: Some(SelectionRangeProviderCapability::Simple(true)), |
48 | folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)), | 49 | folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)), |
49 | rename_provider: Some(RenameProviderCapability::Options(RenameOptions { | 50 | rename_provider: Some(RenameProviderCapability::Options(RenameOptions { |
50 | prepare_provider: Some(true), | 51 | prepare_provider: Some(true), |
diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs index 39361b7e8..2a22b655c 100644 --- a/crates/ra_lsp_server/src/req.rs +++ b/crates/ra_lsp_server/src/req.rs | |||
@@ -10,8 +10,9 @@ pub use lsp_types::{ | |||
10 | DidChangeWatchedFilesParams, DidChangeWatchedFilesRegistrationOptions, | 10 | DidChangeWatchedFilesParams, DidChangeWatchedFilesRegistrationOptions, |
11 | DocumentOnTypeFormattingParams, DocumentSymbolParams, DocumentSymbolResponse, | 11 | DocumentOnTypeFormattingParams, DocumentSymbolParams, DocumentSymbolResponse, |
12 | FileSystemWatcher, Hover, InitializeResult, MessageType, PublishDiagnosticsParams, | 12 | FileSystemWatcher, Hover, InitializeResult, MessageType, PublishDiagnosticsParams, |
13 | ReferenceParams, Registration, RegistrationParams, ShowMessageParams, SignatureHelp, | 13 | ReferenceParams, Registration, RegistrationParams, SelectionRange, SelectionRangeParams, |
14 | TextDocumentEdit, TextDocumentPositionParams, TextEdit, WorkspaceEdit, WorkspaceSymbolParams, | 14 | ShowMessageParams, SignatureHelp, TextDocumentEdit, TextDocumentPositionParams, TextEdit, |
15 | WorkspaceEdit, WorkspaceSymbolParams, | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | pub enum AnalyzerStatus {} | 18 | pub enum AnalyzerStatus {} |
@@ -67,28 +68,6 @@ pub struct ExpandMacroParams { | |||
67 | pub position: Option<Position>, | 68 | pub position: Option<Position>, |
68 | } | 69 | } |
69 | 70 | ||
70 | pub enum SelectionRangeRequest {} | ||
71 | |||
72 | impl Request for SelectionRangeRequest { | ||
73 | type Params = SelectionRangeParams; | ||
74 | type Result = Vec<SelectionRange>; | ||
75 | const METHOD: &'static str = "textDocument/selectionRange"; | ||
76 | } | ||
77 | |||
78 | #[derive(Deserialize, Debug)] | ||
79 | #[serde(rename_all = "camelCase")] | ||
80 | pub struct SelectionRangeParams { | ||
81 | pub text_document: TextDocumentIdentifier, | ||
82 | pub positions: Vec<Position>, | ||
83 | } | ||
84 | |||
85 | #[derive(Serialize, Debug)] | ||
86 | #[serde(rename_all = "camelCase")] | ||
87 | pub struct SelectionRange { | ||
88 | pub range: Range, | ||
89 | pub parent: Option<Box<SelectionRange>>, | ||
90 | } | ||
91 | |||
92 | pub enum FindMatchingBrace {} | 71 | pub enum FindMatchingBrace {} |
93 | 72 | ||
94 | impl Request for FindMatchingBrace { | 73 | impl Request for FindMatchingBrace { |