mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-30 11:37:31 +00:00
Re-implement rust string highlighting via tool attribute
This commit is contained in:
parent
897f7e579e
commit
bf669dab84
72 changed files with 386 additions and 173 deletions
|
|
@ -185,6 +185,14 @@ impl ast::Attr {
|
|||
Some((self.simple_name()?, tt))
|
||||
}
|
||||
|
||||
pub fn as_simple_path(&self) -> Option<ast::Path> {
|
||||
let meta = self.meta()?;
|
||||
if meta.eq_token().is_some() || meta.token_tree().is_some() {
|
||||
return None;
|
||||
}
|
||||
self.path()
|
||||
}
|
||||
|
||||
pub fn simple_name(&self) -> Option<SmolStr> {
|
||||
let path = self.meta()?.path()?;
|
||||
match (path.segment(), path.qualifier()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue