mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Insert unnamed consts to ChildBySource DynMap
This commit is contained in:
parent
354151df35
commit
ec2895e956
2 changed files with 5 additions and 1 deletions
|
@ -80,6 +80,10 @@ impl ChildBySource for ModuleId {
|
|||
impl ChildBySource for ItemScope {
|
||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
||||
self.declarations().for_each(|item| add_module_def(db, res, item));
|
||||
self.unnamed_consts().for_each(|konst| {
|
||||
let src = konst.lookup(db).source(db);
|
||||
res[keys::CONST].insert(src, konst);
|
||||
});
|
||||
self.impls().for_each(|imp| add_impl(db, res, imp));
|
||||
|
||||
fn add_module_def(db: &dyn DefDatabase, map: &mut DynMap, item: ModuleDefId) {
|
||||
|
|
|
@ -30,7 +30,7 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
|
|||
if new_contents.is_empty() {
|
||||
match_ast! {
|
||||
match it {
|
||||
ast::BlockExpr(it) => {
|
||||
ast::BlockExpr(_it) => {
|
||||
macro_call.syntax()
|
||||
.prev_sibling_or_token()
|
||||
.and_then(whitespace_start)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue