mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
fix: Fix ide_db::search not searching bodies of attributed items
This commit is contained in:
parent
ea45e54458
commit
d524e43ef5
4 changed files with 47 additions and 5 deletions
|
@ -171,7 +171,7 @@ fn get_adt_source(
|
|||
adt: &hir::Adt,
|
||||
fn_name: &str,
|
||||
) -> Option<(Option<ast::Impl>, FileId)> {
|
||||
let range = adt.source(ctx.sema.db)?.syntax().original_file_range(ctx.sema.db);
|
||||
let range = adt.source(ctx.sema.db)?.syntax().original_file_range_full(ctx.sema.db);
|
||||
let file = ctx.sema.parse(range.file_id);
|
||||
let adt_source =
|
||||
ctx.sema.find_node_at_offset_with_macros(file.syntax(), range.range.start())?;
|
||||
|
|
|
@ -198,7 +198,7 @@ pub(crate) fn inline_call(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
|
|||
let fn_body = fn_source.value.body()?;
|
||||
let param_list = fn_source.value.param_list()?;
|
||||
|
||||
let FileRange { file_id, range } = fn_source.syntax().original_file_range(ctx.sema.db);
|
||||
let FileRange { file_id, range } = fn_source.syntax().original_file_range_full(ctx.sema.db);
|
||||
if file_id == ctx.file_id() && range.contains(ctx.offset()) {
|
||||
cov_mark::hit!(inline_call_recursive);
|
||||
return None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue