diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-24 00:54:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-24 00:54:21 +0100 |
commit | 601f89f2cb085ab7e638f034088f32b9428a0611 (patch) | |
tree | 2dd1fe075f1343c2a1bfaa03f800d4d3d53809ee /crates/ra_ide/src/syntax_highlighting.rs | |
parent | 5eb51c1e6049c61be60a28894b80a7753f06cfeb (diff) | |
parent | 88d243c742ecd724372c4293b6b6ea293bae2d17 (diff) |
Merge #4114
4114: Refactor completion sorting r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 93d502875..d9912155b 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -19,7 +19,7 @@ use ra_syntax::{ | |||
19 | }; | 19 | }; |
20 | use rustc_hash::FxHashMap; | 20 | use rustc_hash::FxHashMap; |
21 | 21 | ||
22 | use crate::{call_info::call_info_for_token, Analysis, FileId}; | 22 | use crate::{call_info::ActiveParameter, Analysis, FileId}; |
23 | 23 | ||
24 | pub(crate) use html::highlight_as_html; | 24 | pub(crate) use html::highlight_as_html; |
25 | pub use tags::{Highlight, HighlightModifier, HighlightModifiers, HighlightTag}; | 25 | pub use tags::{Highlight, HighlightModifier, HighlightModifiers, HighlightTag}; |
@@ -364,10 +364,8 @@ fn highlight_injection( | |||
364 | literal: ast::RawString, | 364 | literal: ast::RawString, |
365 | expanded: SyntaxToken, | 365 | expanded: SyntaxToken, |
366 | ) -> Option<()> { | 366 | ) -> Option<()> { |
367 | let call_info = call_info_for_token(&sema, expanded)?; | 367 | let active_parameter = ActiveParameter::at_token(&sema, expanded)?; |
368 | let idx = call_info.active_parameter?; | 368 | if !active_parameter.name.starts_with("ra_fixture") { |
369 | let name = call_info.signature.parameter_names.get(idx)?; | ||
370 | if !name.starts_with("ra_fixture") { | ||
371 | return None; | 369 | return None; |
372 | } | 370 | } |
373 | let value = literal.value()?; | 371 | let value = literal.value()?; |