Fix import search not discarding rawness

This commit is contained in:
Lukas Wirth 2025-01-20 14:21:37 +01:00
parent 20ff27e2ba
commit a06606c802
8 changed files with 65 additions and 29 deletions

View file

@ -39,8 +39,8 @@ use stdx::TupleExt;
use syntax::{
algo::skip_trivia_token,
ast::{self, HasAttrs as _, HasGenericParams},
AstNode, AstToken, Direction, SmolStr, SyntaxKind, SyntaxNode, SyntaxNodePtr, SyntaxToken,
TextRange, TextSize,
AstNode, AstToken, Direction, SyntaxKind, SyntaxNode, SyntaxNodePtr, SyntaxToken, TextRange,
TextSize,
};
use triomphe::Arc;
@ -1587,14 +1587,11 @@ impl<'db> SemanticsImpl<'db> {
pub fn resolve_mod_path_relative(
&self,
to: Module,
segments: impl IntoIterator<Item = SmolStr>,
segments: impl IntoIterator<Item = Name>,
) -> Option<impl Iterator<Item = ItemInNs>> {
let items = to.id.resolver(self.db.upcast()).resolve_module_path_in_items(
self.db.upcast(),
&ModPath::from_segments(
hir_def::path::PathKind::Plain,
segments.into_iter().map(|it| Name::new_root(&it)),
),
&ModPath::from_segments(hir_def::path::PathKind::Plain, segments),
);
Some(items.iter_items().map(|(item, _)| item.into()))
}