diff options
author | Paul Daniel Faria <[email protected]> | 2020-06-23 14:17:53 +0100 |
---|---|---|
committer | Paul Daniel Faria <[email protected]> | 2020-06-23 17:13:50 +0100 |
commit | 2a56323537442958008d0fddd78e33df425b11a9 (patch) | |
tree | ee3a7043c21df2aab8be6b7bb2ab83dd6fe4b84f /crates/ra_ide/src/syntax_highlighting/injection.rs | |
parent | d8230acd84dc931f72b9dd32b8fbc2aa887d8b4b (diff) |
Update injection mechanism and stop injecting through highlight element, switch to more general new highlight tag, generic
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting/injection.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/injection.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/injection.rs b/crates/ra_ide/src/syntax_highlighting/injection.rs index 8c724af5b..181c21256 100644 --- a/crates/ra_ide/src/syntax_highlighting/injection.rs +++ b/crates/ra_ide/src/syntax_highlighting/injection.rs | |||
@@ -8,8 +8,8 @@ use ra_syntax::{ast, AstToken, SyntaxNode, SyntaxToken, TextRange, TextSize}; | |||
8 | use stdx::SepBy; | 8 | use stdx::SepBy; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | call_info::ActiveParameter, Analysis, HighlightModifier, HighlightTag, HighlightedRange, | 11 | call_info::ActiveParameter, Analysis, Highlight, HighlightModifier, HighlightTag, |
12 | RootDatabase, | 12 | HighlightedRange, RootDatabase, |
13 | }; | 13 | }; |
14 | 14 | ||
15 | use super::HighlightedRangeStack; | 15 | use super::HighlightedRangeStack; |
@@ -150,8 +150,7 @@ pub(super) fn highlight_doc_comment( | |||
150 | let (analysis, tmp_file_id) = Analysis::from_single_file(text); | 150 | let (analysis, tmp_file_id) = Analysis::from_single_file(text); |
151 | 151 | ||
152 | stack.push(); | 152 | stack.push(); |
153 | for mut h in analysis.with_db(|db| super::highlight(db, tmp_file_id, None, true, true)).unwrap() | 153 | for mut h in analysis.with_db(|db| super::highlight(db, tmp_file_id, None, true)).unwrap() { |
154 | { | ||
155 | // Determine start offset and end offset in case of multi-line ranges | 154 | // Determine start offset and end offset in case of multi-line ranges |
156 | let mut start_offset = None; | 155 | let mut start_offset = None; |
157 | let mut end_offset = None; | 156 | let mut end_offset = None; |
@@ -183,6 +182,7 @@ pub(super) fn highlight_doc_comment( | |||
183 | for comment in new_comments { | 182 | for comment in new_comments { |
184 | stack.add(comment); | 183 | stack.add(comment); |
185 | } | 184 | } |
186 | stack.pop_and_inject(false); | 185 | stack.pop_and_inject(None); |
187 | stack.pop_and_inject(true); | 186 | stack |
187 | .pop_and_inject(Some(Highlight::from(HighlightTag::Generic) | HighlightModifier::Injected)); | ||
188 | } | 188 | } |