mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +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 {
|
impl ChildBySource for ItemScope {
|
||||||
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
|
||||||
self.declarations().for_each(|item| add_module_def(db, res, item));
|
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));
|
self.impls().for_each(|imp| add_impl(db, res, imp));
|
||||||
|
|
||||||
fn add_module_def(db: &dyn DefDatabase, map: &mut DynMap, item: ModuleDefId) {
|
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() {
|
if new_contents.is_empty() {
|
||||||
match_ast! {
|
match_ast! {
|
||||||
match it {
|
match it {
|
||||||
ast::BlockExpr(it) => {
|
ast::BlockExpr(_it) => {
|
||||||
macro_call.syntax()
|
macro_call.syntax()
|
||||||
.prev_sibling_or_token()
|
.prev_sibling_or_token()
|
||||||
.and_then(whitespace_start)
|
.and_then(whitespace_start)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue