aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-05-25 11:42:34 +0100
committerAleksey Kladov <[email protected]>2019-05-25 11:42:34 +0100
commitc6e905a79f7ba083b3f97728aa3a74fb0e03661b (patch)
tree606a17d688e931e35fe45eefd6c13c0baf7bd5bb /crates/ra_ide_api/src/lib.rs
parent9800699bab04e97996f0aebec528714165a2619b (diff)
Colorize Rust code as HTML
Diffstat (limited to 'crates/ra_ide_api/src/lib.rs')
-rw-r--r--crates/ra_ide_api/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs
index f78348f74..d3456d5b2 100644
--- a/crates/ra_ide_api/src/lib.rs
+++ b/crates/ra_ide_api/src/lib.rs
@@ -462,6 +462,11 @@ impl Analysis {
462 self.with_db(|db| syntax_highlighting::highlight(db, file_id)) 462 self.with_db(|db| syntax_highlighting::highlight(db, file_id))
463 } 463 }
464 464
465 /// Computes syntax highlighting for the given file.
466 pub fn highlight_as_html(&self, file_id: FileId) -> Cancelable<String> {
467 self.with_db(|db| syntax_highlighting::highlight_as_html(db, file_id))
468 }
469
465 /// Computes completions at the given position. 470 /// Computes completions at the given position.
466 pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> { 471 pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> {
467 self.with_db(|db| completion::completions(db, position).map(Into::into)) 472 self.with_db(|db| completion::completions(db, position).map(Into::into))