mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Introduce ActiveParameter
This commit is contained in:
parent
4b8e9d5483
commit
09a4b78775
5 changed files with 35 additions and 30 deletions
|
@ -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()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue