Improve macro descension API

This commit is contained in:
Lukas Wirth 2023-12-03 20:20:38 +01:00
parent 986577faaa
commit 5b8e386bae
21 changed files with 179 additions and 139 deletions

View file

@ -4,7 +4,10 @@
use std::collections::BTreeSet;
use either::Either;
use hir::{AssocItem, GenericParam, HirDisplay, ModuleDef, PathResolution, Semantics, Trait};
use hir::{
AssocItem, DescendPreference, GenericParam, HirDisplay, ModuleDef, PathResolution, Semantics,
Trait,
};
use ide_db::{
active_parameter::{callable_for_node, generic_def_for_node},
base_db::FilePosition,
@ -79,7 +82,7 @@ pub(crate) fn signature_help(
// if the cursor is sandwiched between two space tokens and the call is unclosed
// this prevents us from leaving the CallExpression
.and_then(|tok| algo::skip_trivia_token(tok, Direction::Prev))?;
let token = sema.descend_into_macros_single(token, offset);
let token = sema.descend_into_macros_single(DescendPreference::None, token, offset);
for node in token.parent_ancestors() {
match_ast! {