mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-19 01:50:32 +00:00
Create modules in correct directory for nested modules in move_module assist
This commit is contained in:
parent
d6b8af4482
commit
cd5f4121e3
2 changed files with 60 additions and 13 deletions
|
@ -675,6 +675,14 @@ impl ast::LifetimeParam {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::Module {
|
||||
/// Returns the parent ast::Module, this is different than the semantic parent in that this only
|
||||
/// considers parent declarations in the AST
|
||||
pub fn parent(&self) -> Option<ast::Module> {
|
||||
self.syntax().ancestors().nth(2).and_then(ast::Module::cast)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::RangePat {
|
||||
pub fn start(&self) -> Option<ast::Pat> {
|
||||
self.syntax()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue