mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
complete items from module scope
This commit is contained in:
parent
d34588bf83
commit
537ea620bb
6 changed files with 100 additions and 18 deletions
|
@ -1441,6 +1441,10 @@ impl<'a> AstNode<'a> for Root<'a> {
|
|||
}
|
||||
|
||||
impl<'a> Root<'a> {
|
||||
pub fn items(self) -> impl Iterator<Item = ModuleItem<'a>> + 'a {
|
||||
super::children(self)
|
||||
}
|
||||
|
||||
pub fn functions(self) -> impl Iterator<Item = FnDef<'a>> + 'a {
|
||||
super::children(self)
|
||||
}
|
||||
|
|
|
@ -238,6 +238,7 @@ Grammar(
|
|||
ast: {
|
||||
"Root": (
|
||||
collections: [
|
||||
["items", "ModuleItem"],
|
||||
["functions", "FnDef"],
|
||||
["modules", "Module"],
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue