mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Treat BlockExpr as a potential module origin
This commit is contained in:
parent
7d5ed18c42
commit
82146737ac
8 changed files with 44 additions and 7 deletions
|
@ -294,6 +294,7 @@ impl ToNav for hir::Module {
|
|||
ModuleSource::Module(node) => {
|
||||
(node.syntax(), node.name().map(|it| it.syntax().text_range()))
|
||||
}
|
||||
ModuleSource::BlockExpr(node) => (node.syntax(), None),
|
||||
};
|
||||
let frange = src.with_value(syntax).original_file_range(db);
|
||||
NavigationTarget::from_syntax(frange.file_id, name, focus, frange.range, SymbolKind::Module)
|
||||
|
|
|
@ -53,6 +53,12 @@ impl ShortLabel for ast::SourceFile {
|
|||
}
|
||||
}
|
||||
|
||||
impl ShortLabel for ast::BlockExpr {
|
||||
fn short_label(&self) -> Option<String> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl ShortLabel for ast::TypeAlias {
|
||||
fn short_label(&self) -> Option<String> {
|
||||
short_label_from_node(self, "type ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue