Skip to content

Commit 6f4762f

Browse files
bors[bot]kjeremy
andauthored
Merge #3532
3532: Fix SelectionRange return type r=matklad a=kjeremy Co-authored-by: kjeremy <kjeremy@gmail.com>
2 parents bf3eef8 + c981c8b commit 6f4762f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ra_cargo_watch/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["rust-analyzer developers"]
66

77
[dependencies]
88
crossbeam-channel = "0.4.0"
9-
lsp-types = { version = "0.72.0", features = ["proposed"] }
9+
lsp-types = { version = "0.73.0", features = ["proposed"] }
1010
log = "0.4.8"
1111
cargo_metadata = "0.9.1"
1212
serde_json = "1.0.48"

crates/rust-analyzer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ globset = "0.4.4"
2020
itertools = "0.8.2"
2121
jod-thread = "0.1.0"
2222
log = "0.4.8"
23-
lsp-types = { version = "0.72.0", features = ["proposed"] }
23+
lsp-types = { version = "0.73.0", features = ["proposed"] }
2424
parking_lot = "0.10.0"
2525
pico-args = "0.3.1"
2626
rand = { version = "0.7.3", features = ["small_rng"] }

crates/rust-analyzer/src/main_loop/handlers.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ pub fn handle_expand_macro(
8585
pub fn handle_selection_range(
8686
world: WorldSnapshot,
8787
params: req::SelectionRangeParams,
88-
) -> Result<Vec<req::SelectionRange>> {
88+
) -> Result<Option<Vec<req::SelectionRange>>> {
8989
let _p = profile("handle_selection_range");
9090
let file_id = params.text_document.try_conv_with(&world)?;
9191
let line_index = world.analysis().file_line_index(file_id)?;
92-
params
92+
let res: Result<Vec<req::SelectionRange>> = params
9393
.positions
9494
.into_iter()
9595
.map_conv_with(&line_index)
@@ -120,7 +120,9 @@ pub fn handle_selection_range(
120120
}
121121
Ok(range)
122122
})
123-
.collect()
123+
.collect();
124+
125+
Ok(Some(res?))
124126
}
125127

126128
pub fn handle_find_matching_brace(

0 commit comments

Comments
 (0)