mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
rename module source
This commit is contained in:
parent
2ed1514df3
commit
22949dab26
4 changed files with 32 additions and 32 deletions
|
@ -34,10 +34,11 @@ pub(crate) fn resolve_based_completion(
|
|||
let source_root_id = db.file_source_root(position.file_id);
|
||||
let file = db.file_syntax(position.file_id);
|
||||
let module_tree = db.module_tree(source_root_id)?;
|
||||
let module_id = match module_tree.any_module_for_source(ModuleSource::File(position.file_id)) {
|
||||
None => return Ok(None),
|
||||
Some(it) => it,
|
||||
};
|
||||
let module_id =
|
||||
match module_tree.any_module_for_source(ModuleSource::SourceFile(position.file_id)) {
|
||||
None => return Ok(None),
|
||||
Some(it) => it,
|
||||
};
|
||||
let file = {
|
||||
let edit = AtomEdit::insert(position.offset, "intellijRulezz".to_string());
|
||||
file.reparse(&edit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue