rust/crates/ra_ide_api/src/syntax_highlighting.rs

13 lines
305 B
Rust
Raw Normal View History

2019-03-16 11:40:41 -05:00
use ra_syntax::AstNode;
2019-01-26 02:20:30 -06:00
use ra_db::SourceDatabase;
2019-01-08 13:33:36 -06:00
use crate::{
2019-01-15 12:17:10 -06:00
FileId, HighlightedRange,
2019-01-08 13:33:36 -06:00
db::RootDatabase,
};
2019-01-15 12:17:10 -06:00
pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRange> {
2019-01-26 02:51:36 -06:00
let source_file = db.parse(file_id);
2019-03-16 11:40:41 -05:00
ra_ide_api_light::highlight(source_file.syntax())
2019-01-08 13:33:36 -06:00
}