From 82146737acc74b2483f39f1dd0ae4dfffcfda824 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 20 Jan 2021 20:05:48 +0100 Subject: Treat BlockExpr as a potential module origin --- crates/ide/src/display/navigation_target.rs | 1 + crates/ide/src/display/short_label.rs | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'crates/ide/src/display') diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index 671aa1373..9c568c90c 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs @@ -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) diff --git a/crates/ide/src/display/short_label.rs b/crates/ide/src/display/short_label.rs index b8e4cc181..7ac050473 100644 --- a/crates/ide/src/display/short_label.rs +++ b/crates/ide/src/display/short_label.rs @@ -53,6 +53,12 @@ impl ShortLabel for ast::SourceFile { } } +impl ShortLabel for ast::BlockExpr { + fn short_label(&self) -> Option { + None + } +} + impl ShortLabel for ast::TypeAlias { fn short_label(&self) -> Option { short_label_from_node(self, "type ") -- cgit v1.2.3