diff options
author | Leander Tentrup <[email protected]> | 2020-06-14 13:43:43 +0100 |
---|---|---|
committer | Leander Tentrup <[email protected]> | 2020-06-15 21:13:53 +0100 |
commit | c4b3db0c2f307d1d782af88ded260e4c6593cae0 (patch) | |
tree | dd32c19bf36913db87d0dde84f70e6fd1b4c2e5a /crates/ra_ide/src/syntax_highlighting/injection.rs | |
parent | f4f51171ca6d99b693df2ef6fb71f0347999aa9f (diff) |
Syntactic highlighting of NAME_REF for injections
This commit adds a function that tries to determine the syntax highlighting class of NAME_REFs based on the usage.
It is used for highlighting injections (such as highlighting of doctests) as the semantic logic will most of the time result in unresolved references.
It also adds a color to unresolved references in HTML encoding.
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting/injection.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting/injection.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/injection.rs b/crates/ra_ide/src/syntax_highlighting/injection.rs index 3575a0fc6..a02ffe59e 100644 --- a/crates/ra_ide/src/syntax_highlighting/injection.rs +++ b/crates/ra_ide/src/syntax_highlighting/injection.rs | |||
@@ -137,7 +137,7 @@ pub(super) fn highlight_doc_comment( | |||
137 | let (analysis, tmp_file_id) = Analysis::from_single_file(text); | 137 | let (analysis, tmp_file_id) = Analysis::from_single_file(text); |
138 | 138 | ||
139 | stack.push(); | 139 | stack.push(); |
140 | for mut h in analysis.highlight(tmp_file_id).unwrap() { | 140 | for mut h in analysis.with_db(|db| super::highlight(db, tmp_file_id, None, true)).unwrap() { |
141 | // Determine start offset and end offset in case of multi-line ranges | 141 | // Determine start offset and end offset in case of multi-line ranges |
142 | let mut start_offset = None; | 142 | let mut start_offset = None; |
143 | let mut end_offset = None; | 143 | let mut end_offset = None; |