reformat the world

This commit is contained in:
Aleksey Kladov 2019-02-08 14:49:43 +03:00
parent 5cb1d41a30
commit 12e3b4c70b
129 changed files with 727 additions and 2509 deletions

View file

@ -9,20 +9,12 @@ use crate::{
pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRange> {
let source_file = db.parse(file_id);
let mut res = ra_ide_api_light::highlight(source_file.syntax());
for macro_call in source_file
.syntax()
.descendants()
.filter_map(ast::MacroCall::cast)
{
for macro_call in source_file.syntax().descendants().filter_map(ast::MacroCall::cast) {
if let Some((off, exp)) = hir::MacroDef::ast_expand(macro_call) {
let mapped_ranges = ra_ide_api_light::highlight(&exp.syntax())
.into_iter()
.filter_map(|r| {
let mapped_ranges =
ra_ide_api_light::highlight(&exp.syntax()).into_iter().filter_map(|r| {
let mapped_range = exp.map_range_back(r.range)?;
let res = HighlightedRange {
range: mapped_range + off,
tag: r.tag,
};
let res = HighlightedRange { range: mapped_range + off, tag: r.tag };
Some(res)
});
res.extend(mapped_ranges);