From 1ec1bd8139251092e567d0b6034f96e3fdf33afb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 20 Jan 2019 20:59:46 +0300 Subject: make matching brace consistent --- crates/ra_ide_api/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide_api') 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 { /// Returns position of the mathcing brace (all types of braces are /// supported). - pub fn matching_brace(&self, file: &SourceFile, offset: TextUnit) -> Option { - ra_ide_api_light::matching_brace(file, offset) + pub fn matching_brace(&self, position: FilePosition) -> Option { + let file = self.db.source_file(position.file_id); + ra_ide_api_light::matching_brace(&file, position.offset) } /// Returns a syntax tree represented as `String`, for debug purposes. -- cgit v1.2.3