mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
More symbols
This commit is contained in:
parent
fe1fe866f3
commit
56aa6e20e0
7 changed files with 42 additions and 22 deletions
|
@ -180,3 +180,22 @@ impl<R: TreeRoot> AstNode<R> for Trait<R> {
|
|||
impl<R: TreeRoot> ast::NameOwner<R> for Trait<R> {}
|
||||
impl<R: TreeRoot> Trait<R> {}
|
||||
|
||||
// TypeItem
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct TypeItem<R: TreeRoot = Arc<SyntaxRoot>> {
|
||||
syntax: SyntaxNode<R>,
|
||||
}
|
||||
|
||||
impl<R: TreeRoot> AstNode<R> for TypeItem<R> {
|
||||
fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
|
||||
match syntax.kind() {
|
||||
TYPE_ITEM => Some(TypeItem { syntax }),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode<R> { &self.syntax }
|
||||
}
|
||||
|
||||
impl<R: TreeRoot> ast::NameOwner<R> for TypeItem<R> {}
|
||||
impl<R: TreeRoot> TypeItem<R> {}
|
||||
|
||||
|
|
|
@ -219,27 +219,14 @@ Grammar(
|
|||
["functions", "Function"]
|
||||
]
|
||||
),
|
||||
"Function": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Struct": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Enum": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Trait": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Module": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"ConstItem": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"StaticItem": (
|
||||
traits: ["NameOwner"]
|
||||
),
|
||||
"Function": ( traits: ["NameOwner"] ),
|
||||
"Struct": ( traits: ["NameOwner"] ),
|
||||
"Enum": ( traits: ["NameOwner"] ),
|
||||
"Trait": ( traits: ["NameOwner"] ),
|
||||
"Module": ( traits: ["NameOwner"] ),
|
||||
"ConstItem": ( traits: ["NameOwner"] ),
|
||||
"StaticItem": ( traits: ["NameOwner"] ),
|
||||
"TypeItem": ( traits: ["NameOwner"] ),
|
||||
"Name": (),
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue