From 09a4b78775809677473b39505796785242bcee2f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 01:46:00 +0200 Subject: Introduce ActiveParameter --- crates/ra_ide/src/syntax_highlighting.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src/syntax_highlighting.rs') 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::{ }; use rustc_hash::FxHashMap; -use crate::{call_info::call_info_for_token, Analysis, FileId}; +use crate::{call_info::ActiveParameter, Analysis, FileId}; pub(crate) use html::highlight_as_html; pub use tags::{Highlight, HighlightModifier, HighlightModifiers, HighlightTag}; @@ -364,10 +364,8 @@ fn highlight_injection( literal: ast::RawString, expanded: SyntaxToken, ) -> Option<()> { - let call_info = call_info_for_token(&sema, expanded)?; - let idx = call_info.active_parameter?; - let name = call_info.signature.parameter_names.get(idx)?; - if !name.starts_with("ra_fixture") { + let active_parameter = ActiveParameter::at_token(&sema, expanded)?; + if !active_parameter.name.starts_with("ra_fixture") { return None; } let value = literal.value()?; -- cgit v1.2.3