diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-09 14:29:59 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-09 14:29:59 +0000 |
commit | 6f4762f310d93252590537b8a3d21333d8f3a5a9 (patch) | |
tree | 8e98c80e59cb60b66b7ed40bbe5b13550380aa8a /crates | |
parent | bf3eef8897502be4481eb663167c6ca5a2992fec (diff) | |
parent | c981c8b0d0c48c7fa984add643c3ca0bb39c9776 (diff) |
Merge #3532
3532: Fix SelectionRange return type r=matklad a=kjeremy
Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_cargo_watch/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 8 |
3 files changed, 7 insertions, 5 deletions
diff --git a/crates/ra_cargo_watch/Cargo.toml b/crates/ra_cargo_watch/Cargo.toml index 731d50371..d38d0e2b0 100644 --- a/crates/ra_cargo_watch/Cargo.toml +++ b/crates/ra_cargo_watch/Cargo.toml | |||
@@ -6,7 +6,7 @@ authors = ["rust-analyzer developers"] | |||
6 | 6 | ||
7 | [dependencies] | 7 | [dependencies] |
8 | crossbeam-channel = "0.4.0" | 8 | crossbeam-channel = "0.4.0" |
9 | lsp-types = { version = "0.72.0", features = ["proposed"] } | 9 | lsp-types = { version = "0.73.0", features = ["proposed"] } |
10 | log = "0.4.8" | 10 | log = "0.4.8" |
11 | cargo_metadata = "0.9.1" | 11 | cargo_metadata = "0.9.1" |
12 | serde_json = "1.0.48" | 12 | serde_json = "1.0.48" |
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index b14ebb268..d44f0ef1d 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -20,7 +20,7 @@ globset = "0.4.4" | |||
20 | itertools = "0.8.2" | 20 | itertools = "0.8.2" |
21 | jod-thread = "0.1.0" | 21 | jod-thread = "0.1.0" |
22 | log = "0.4.8" | 22 | log = "0.4.8" |
23 | lsp-types = { version = "0.72.0", features = ["proposed"] } | 23 | lsp-types = { version = "0.73.0", features = ["proposed"] } |
24 | parking_lot = "0.10.0" | 24 | parking_lot = "0.10.0" |
25 | pico-args = "0.3.1" | 25 | pico-args = "0.3.1" |
26 | rand = { version = "0.7.3", features = ["small_rng"] } | 26 | rand = { version = "0.7.3", features = ["small_rng"] } |
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index b498c90c9..8dc6e8dc0 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs | |||
@@ -85,11 +85,11 @@ pub fn handle_expand_macro( | |||
85 | pub fn handle_selection_range( | 85 | pub fn handle_selection_range( |
86 | world: WorldSnapshot, | 86 | world: WorldSnapshot, |
87 | params: req::SelectionRangeParams, | 87 | params: req::SelectionRangeParams, |
88 | ) -> Result<Vec<req::SelectionRange>> { | 88 | ) -> Result<Option<Vec<req::SelectionRange>>> { |
89 | let _p = profile("handle_selection_range"); | 89 | let _p = profile("handle_selection_range"); |
90 | let file_id = params.text_document.try_conv_with(&world)?; | 90 | let file_id = params.text_document.try_conv_with(&world)?; |
91 | let line_index = world.analysis().file_line_index(file_id)?; | 91 | let line_index = world.analysis().file_line_index(file_id)?; |
92 | params | 92 | let res: Result<Vec<req::SelectionRange>> = params |
93 | .positions | 93 | .positions |
94 | .into_iter() | 94 | .into_iter() |
95 | .map_conv_with(&line_index) | 95 | .map_conv_with(&line_index) |
@@ -120,7 +120,9 @@ pub fn handle_selection_range( | |||
120 | } | 120 | } |
121 | Ok(range) | 121 | Ok(range) |
122 | }) | 122 | }) |
123 | .collect() | 123 | .collect(); |
124 | |||
125 | Ok(Some(res?)) | ||
124 | } | 126 | } |
125 | 127 | ||
126 | pub fn handle_find_matching_brace( | 128 | pub fn handle_find_matching_brace( |