mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Make helper method less specific
This commit is contained in:
parent
8a92910f97
commit
f458ea15d6
2 changed files with 5 additions and 7 deletions
|
@ -4,7 +4,7 @@ use syntax::{
|
|||
TextRange, TextSize,
|
||||
};
|
||||
|
||||
use super::node_ext::get_outer_macro_name;
|
||||
use super::node_ext::get_outer_macro;
|
||||
|
||||
pub fn is_format_string(string: &ast::String) -> bool {
|
||||
// Check if `string` is a format string argument of a macro invocation.
|
||||
|
@ -16,7 +16,7 @@ pub fn is_format_string(string: &ast::String) -> bool {
|
|||
// This setup lets us correctly highlight the components of `concat!("{}", "bla")` format
|
||||
// strings. It still fails for `concat!("{", "}")`, but that is rare.
|
||||
(|| {
|
||||
let name = get_outer_macro_name(string)?;
|
||||
let name = get_outer_macro(string)?.path()?.segment()?.name_ref()?;
|
||||
|
||||
if !matches!(
|
||||
name.text().as_str(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue