mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-22 11:24:24 +00:00
Implement RawAttr::filter
This commit is contained in:
parent
03c177af89
commit
08de1b4fa5
5 changed files with 76 additions and 3 deletions
|
@ -205,6 +205,13 @@ impl ast::Type {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::Attr {
|
||||
/// Returns `text`, parsed as an attribute, but only if it has no errors.
|
||||
pub fn parse(text: &str) -> Result<Self, ()> {
|
||||
parsing::parse_text_fragment(text, parser::FragmentKind::Attr)
|
||||
}
|
||||
}
|
||||
|
||||
/// Matches a `SyntaxNode` against an `ast` type.
|
||||
///
|
||||
/// # Example:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue