Skip to content

Commit ec2895e

Browse files
committed
Insert unnamed consts to ChildBySource DynMap
1 parent 354151d commit ec2895e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/hir_def/src/child_by_source.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ impl ChildBySource for ModuleId {
8080
impl ChildBySource for ItemScope {
8181
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
8282
self.declarations().for_each(|item| add_module_def(db, res, item));
83+
self.unnamed_consts().for_each(|konst| {
84+
let src = konst.lookup(db).source(db);
85+
res[keys::CONST].insert(src, konst);
86+
});
8387
self.impls().for_each(|imp| add_impl(db, res, imp));
8488

8589
fn add_module_def(db: &dyn DefDatabase, map: &mut DynMap, item: ModuleDefId) {

crates/ide_assists/src/handlers/remove_dbg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
3030
if new_contents.is_empty() {
3131
match_ast! {
3232
match it {
33-
ast::BlockExpr(it) => {
33+
ast::BlockExpr(_it) => {
3434
macro_call.syntax()
3535
.prev_sibling_or_token()
3636
.and_then(whitespace_start)

0 commit comments

Comments
 (0)