mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Colorize Rust code as HTML
This commit is contained in:
parent
9800699bab
commit
c6e905a79f
5 changed files with 138 additions and 153 deletions
|
@ -462,6 +462,11 @@ impl Analysis {
|
|||
self.with_db(|db| syntax_highlighting::highlight(db, file_id))
|
||||
}
|
||||
|
||||
/// Computes syntax highlighting for the given file.
|
||||
pub fn highlight_as_html(&self, file_id: FileId) -> Cancelable<String> {
|
||||
self.with_db(|db| syntax_highlighting::highlight_as_html(db, file_id))
|
||||
}
|
||||
|
||||
/// Computes completions at the given position.
|
||||
pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> {
|
||||
self.with_db(|db| completion::completions(db, position).map(Into::into))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue