diff options
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 5 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index ca6b25516..9ee5467ed 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -316,8 +316,9 @@ impl Analysis { | |||
316 | 316 | ||
317 | /// Returns position of the mathcing brace (all types of braces are | 317 | /// Returns position of the mathcing brace (all types of braces are |
318 | /// supported). | 318 | /// supported). |
319 | pub fn matching_brace(&self, file: &SourceFile, offset: TextUnit) -> Option<TextUnit> { | 319 | pub fn matching_brace(&self, position: FilePosition) -> Option<TextUnit> { |
320 | ra_ide_api_light::matching_brace(file, offset) | 320 | let file = self.db.source_file(position.file_id); |
321 | ra_ide_api_light::matching_brace(&file, position.offset) | ||
321 | } | 322 | } |
322 | 323 | ||
323 | /// Returns a syntax tree represented as `String`, for debug purposes. | 324 | /// Returns a syntax tree represented as `String`, for debug purposes. |
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 8f9db68a2..b70d67b4d 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -51,7 +51,6 @@ pub fn handle_find_matching_brace( | |||
51 | params: req::FindMatchingBraceParams, | 51 | params: req::FindMatchingBraceParams, |
52 | ) -> Result<Vec<Position>> { | 52 | ) -> Result<Vec<Position>> { |
53 | let file_id = params.text_document.try_conv_with(&world)?; | 53 | let file_id = params.text_document.try_conv_with(&world)?; |
54 | let file = world.analysis().file_syntax(file_id); | ||
55 | let line_index = world.analysis().file_line_index(file_id); | 54 | let line_index = world.analysis().file_line_index(file_id); |
56 | let res = params | 55 | let res = params |
57 | .offsets | 56 | .offsets |
@@ -60,7 +59,7 @@ pub fn handle_find_matching_brace( | |||
60 | .map(|offset| { | 59 | .map(|offset| { |
61 | world | 60 | world |
62 | .analysis() | 61 | .analysis() |
63 | .matching_brace(&file, offset) | 62 | .matching_brace(FilePosition { file_id, offset }) |
64 | .unwrap_or(offset) | 63 | .unwrap_or(offset) |
65 | }) | 64 | }) |
66 | .map_conv_with(&line_index) | 65 | .map_conv_with(&line_index) |