Skip to content

Commit 97779e6

Browse files
committed
Highlight the entire covering_element's text range
Instead of only highlighting the requested text_range we want to highlight the text range of the covering element which might be greater than the given text range. This is to prevent us from breaking the assumption that the highlighted elements in a node are always contained inside the root text range.
1 parent 286d90d commit 97779e6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/ide/src/syntax_highlighting.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub(crate) fn highlight(
6666
NodeOrToken::Node(it) => it,
6767
NodeOrToken::Token(it) => it.parent(),
6868
};
69+
let range = node.text_range();
6970
(node, range)
7071
}
7172
None => (source_file.syntax().clone(), source_file.syntax().text_range()),

0 commit comments

Comments
 (0)