From 8f6f864547bad3d2bb34ea0cf5a32e8adee58c4e Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Tue, 25 Feb 2020 08:38:50 -0500 Subject: Semantic Ranges --- crates/ra_ide/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_ide/src/lib.rs') diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 82e10bc7e..c02bb08a0 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -430,6 +430,13 @@ impl Analysis { self.with_db(|db| syntax_highlighting::highlight(db, file_id)) } + /// Computes syntax highlighting for the given file range. + pub fn highlight_range(&self, frange: FileRange) -> Cancelable> { + self.with_db(|db| { + syntax_highlighting::highlight_range(db, frange.file_id, Some(frange.range)) + }) + } + /// Computes syntax highlighting for the given file. pub fn highlight_as_html(&self, file_id: FileId, rainbow: bool) -> Cancelable { self.with_db(|db| syntax_highlighting::highlight_as_html(db, file_id, rainbow)) -- cgit v1.2.3 From fa355d6339d7b5ccfd4b1a96f035a4366e8152fe Mon Sep 17 00:00:00 2001 From: kjeremy Date: Tue, 25 Feb 2020 14:44:47 -0500 Subject: Rename back to highlight and check event's again highlight range --- crates/ra_ide/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src/lib.rs') diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index c02bb08a0..d22870669 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -425,16 +425,14 @@ impl Analysis { self.with_db(|db| runnables::runnables(db, file_id)) } - /// Computes syntax highlighting for the given file. + /// Computes syntax highlighting for the given file pub fn highlight(&self, file_id: FileId) -> Cancelable> { - self.with_db(|db| syntax_highlighting::highlight(db, file_id)) + self.with_db(|db| syntax_highlighting::highlight(db, file_id, None)) } /// Computes syntax highlighting for the given file range. pub fn highlight_range(&self, frange: FileRange) -> Cancelable> { - self.with_db(|db| { - syntax_highlighting::highlight_range(db, frange.file_id, Some(frange.range)) - }) + self.with_db(|db| syntax_highlighting::highlight(db, frange.file_id, Some(frange.range))) } /// Computes syntax highlighting for the given file. -- cgit v1.2.3