This commit is contained in:
Aleksey Kladov 2020-08-27 15:02:56 +02:00
parent e7da5816d6
commit 4d0cfc07fd

View file

@ -2,6 +2,7 @@
use base_db::SourceDatabase; use base_db::SourceDatabase;
use oorandom::Rand32; use oorandom::Rand32;
use stdx::format_to;
use syntax::{AstNode, TextRange, TextSize}; use syntax::{AstNode, TextRange, TextSize};
use crate::{syntax_highlighting::highlight, FileId, RootDatabase}; use crate::{syntax_highlighting::highlight, FileId, RootDatabase};
@ -40,7 +41,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo
} }
_ => "".into(), _ => "".into(),
}; };
buf.push_str(&format!("<span class=\"{}\"{}>{}</span>", class, color, html_escape(curr))); format_to!(buf, "<span class=\"{}\"{}>{}</span>", class, color, html_escape(curr));
prev_pos = range.range.end(); prev_pos = range.range.end();
} }