mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Disable string highlight injection for macros changing string literals
This commit is contained in:
parent
ec07bb98f8
commit
f3b25a6fc8
3 changed files with 31 additions and 29 deletions
|
@ -10,7 +10,7 @@ use ide_db::{
|
|||
};
|
||||
use syntax::{
|
||||
ast::{self, AstNode, IsString},
|
||||
AstToken, NodeOrToken, SyntaxNode, SyntaxToken, TextRange, TextSize,
|
||||
AstToken, NodeOrToken, SyntaxNode, TextRange, TextSize,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
|
@ -22,10 +22,10 @@ use crate::{
|
|||
pub(super) fn ra_fixture(
|
||||
hl: &mut Highlights,
|
||||
sema: &Semantics<RootDatabase>,
|
||||
literal: ast::String,
|
||||
expanded: SyntaxToken,
|
||||
literal: &ast::String,
|
||||
expanded: &ast::String,
|
||||
) -> Option<()> {
|
||||
let active_parameter = ActiveParameter::at_token(sema, expanded)?;
|
||||
let active_parameter = ActiveParameter::at_token(sema, expanded.syntax().clone())?;
|
||||
if !active_parameter.ident().map_or(false, |name| name.text().starts_with("ra_fixture")) {
|
||||
return None;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue