mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
convenience api
This commit is contained in:
parent
a6df224f7d
commit
191a6ba330
8 changed files with 63 additions and 50 deletions
|
@ -237,8 +237,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo
|
|||
let mut buf = String::new();
|
||||
buf.push_str(&STYLE);
|
||||
buf.push_str("<pre><code>");
|
||||
let tokens =
|
||||
parse.tree().syntax().descendants_with_tokens().filter_map(|it| it.as_token().cloned());
|
||||
let tokens = parse.tree().syntax().descendants_with_tokens().filter_map(|it| it.into_token());
|
||||
for token in tokens {
|
||||
could_intersect.retain(|it| token.range().start() <= it.range.end());
|
||||
while let Some(r) = ranges.get(frontier) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue