No block at the moment
This commit is contained in:
parent
032eb3d68e
commit
088f50c0ab
crates
ra_hir/src
ra_hir_def/src
ra_ide/src
@ -257,7 +257,7 @@ impl Module {
|
||||
InFile { file_id: src.file_id, value: module.clone() },
|
||||
);
|
||||
}
|
||||
ModuleSource::SourceFile(_) | ModuleSource::Block(_) => (),
|
||||
ModuleSource::SourceFile(_) => (),
|
||||
};
|
||||
|
||||
let original_file = src.file_id.original_file(db);
|
||||
|
@ -109,7 +109,6 @@ pub enum ModuleOrigin {
|
||||
/// Note that non-inline modules, by definition, live inside non-macro file.
|
||||
File(AstId<ast::Module>, FileId),
|
||||
Inline(AstId<ast::Module>),
|
||||
Block(AstId<ast::Block>),
|
||||
}
|
||||
|
||||
impl Default for ModuleOrigin {
|
||||
@ -140,7 +139,7 @@ impl ModuleOrigin {
|
||||
pub fn declaration(&self) -> Option<AstId<ast::Module>> {
|
||||
match self {
|
||||
ModuleOrigin::File(m, _) | ModuleOrigin::Inline(m) => Some(*m),
|
||||
ModuleOrigin::Root(_) | ModuleOrigin::Block(_) => None,
|
||||
ModuleOrigin::Root(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,7 +161,6 @@ impl ModuleOrigin {
|
||||
}
|
||||
ModuleOrigin::Root(None) => unreachable!(),
|
||||
ModuleOrigin::Inline(m) => InFile::new(m.file_id, ModuleSource::Module(m.to_node(db))),
|
||||
ModuleOrigin::Block(b) => InFile::new(b.file_id, ModuleSource::Block(b.to_node(db))),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -360,7 +358,6 @@ impl ModuleData {
|
||||
pub enum ModuleSource {
|
||||
SourceFile(ast::SourceFile),
|
||||
Module(ast::Module),
|
||||
Block(ast::Block),
|
||||
}
|
||||
|
||||
impl ModuleSource {
|
||||
@ -384,8 +381,6 @@ impl ModuleSource {
|
||||
child.value.ancestors().filter_map(ast::Module::cast).find(|it| !it.has_semi())
|
||||
{
|
||||
ModuleSource::Module(m)
|
||||
} else if let Some(b) = child.value.ancestors().filter_map(ast::Block::cast).next() {
|
||||
ModuleSource::Block(b)
|
||||
} else {
|
||||
let file_id = child.file_id.original_file(db);
|
||||
let source_file = db.parse(file_id).tree();
|
||||
|
@ -234,7 +234,6 @@ impl ToNav for hir::Module {
|
||||
let syntax = match &src.value {
|
||||
ModuleSource::SourceFile(node) => node.syntax(),
|
||||
ModuleSource::Module(node) => node.syntax(),
|
||||
ModuleSource::Block(node) => node.syntax(),
|
||||
};
|
||||
let frange = original_range(db, src.with_value(syntax));
|
||||
NavigationTarget::from_syntax(
|
||||
|
@ -88,7 +88,7 @@ fn rename_mod(
|
||||
file_system_edits.push(move_file);
|
||||
}
|
||||
}
|
||||
ModuleSource::Module(..) | ModuleSource::Block(..) => {}
|
||||
ModuleSource::Module(..) => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,10 +96,6 @@ impl NameDefinition {
|
||||
let range = Some(m.syntax().text_range());
|
||||
res.insert(file_id, range);
|
||||
}
|
||||
ModuleSource::Block(b) => {
|
||||
let range = Some(b.syntax().text_range());
|
||||
res.insert(file_id, range);
|
||||
}
|
||||
ModuleSource::SourceFile(_) => {
|
||||
res.insert(file_id, None);
|
||||
res.extend(parent_module.children(db).map(|m| {
|
||||
@ -141,7 +137,6 @@ impl NameDefinition {
|
||||
let mut res = FxHashMap::default();
|
||||
let range = match module_src.value {
|
||||
ModuleSource::Module(m) => Some(m.syntax().text_range()),
|
||||
ModuleSource::Block(b) => Some(b.syntax().text_range()),
|
||||
ModuleSource::SourceFile(_) => None,
|
||||
};
|
||||
res.insert(file_id, range);
|
||||
|
Loading…
x
Reference in New Issue
Block a user