mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Merge #11177
11177: internal: dont descend into comments r=Veykril a=jhgg fixes #11176 Co-authored-by: Jake Heinz <jh@discordapp.com>
This commit is contained in:
commit
8e9ccbf97a
1 changed files with 4 additions and 1 deletions
|
@ -282,7 +282,10 @@ fn traverse(
|
||||||
|
|
||||||
// only attempt to descend if we are inside a macro call or attribute
|
// only attempt to descend if we are inside a macro call or attribute
|
||||||
// as calling `descend_into_macros_single` gets rather expensive if done for every single token
|
// as calling `descend_into_macros_single` gets rather expensive if done for every single token
|
||||||
let descend_token = current_macro_call.is_some() || current_attr_call.is_some();
|
// additionally, do not descend into comments, descending maps down to doc attributes which get
|
||||||
|
// tagged as string literals.
|
||||||
|
let descend_token = (current_macro_call.is_some() || current_attr_call.is_some())
|
||||||
|
&& element.kind() != COMMENT;
|
||||||
let element_to_highlight = if descend_token {
|
let element_to_highlight = if descend_token {
|
||||||
let token = match &element {
|
let token = match &element {
|
||||||
NodeOrToken::Node(_) => continue,
|
NodeOrToken::Node(_) => continue,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue