diff options
author | Aleksey Kladov <[email protected]> | 2018-12-28 10:14:39 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-28 10:14:39 +0000 |
commit | dc496d05160f9693a4e48977b7f7a3fe2689ac51 (patch) | |
tree | 2a88e1538f96be40713f0e08fed8101393485bf4 /crates/ra_analysis/src/syntax_highlighting.rs | |
parent | e80021cbd0bcfea82f3b855e13a409c73b563673 (diff) |
move highlightning to a separate file
Diffstat (limited to 'crates/ra_analysis/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_analysis/src/syntax_highlighting.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/syntax_highlighting.rs b/crates/ra_analysis/src/syntax_highlighting.rs new file mode 100644 index 000000000..65409beb2 --- /dev/null +++ b/crates/ra_analysis/src/syntax_highlighting.rs | |||
@@ -0,0 +1,12 @@ | |||
1 | use ra_editor::HighlightedRange; | ||
2 | use ra_db::SyntaxDatabase; | ||
3 | |||
4 | use crate::{ | ||
5 | db::RootDatabase, | ||
6 | FileId, Cancelable, | ||
7 | }; | ||
8 | |||
9 | pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> { | ||
10 | let file = db.source_file(file_id); | ||
11 | Ok(ra_editor::highlight(&file)) | ||
12 | } | ||