mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Upgrade salsa (#13757)
This commit is contained in:
parent
72ac6cd5a5
commit
5f65e842e8
12 changed files with 143 additions and 120 deletions
|
@ -19,18 +19,18 @@ impl<'a> Resolver<'a> {
|
|||
pub(crate) fn resolve(&self, import: CollectedImport) -> Option<&'a FilePath> {
|
||||
match import {
|
||||
CollectedImport::Import(import) => {
|
||||
resolve_module(self.db, import).map(|module| module.file().path(self.db))
|
||||
resolve_module(self.db, &import).map(|module| module.file().path(self.db))
|
||||
}
|
||||
CollectedImport::ImportFrom(import) => {
|
||||
// Attempt to resolve the member (e.g., given `from foo import bar`, look for `foo.bar`).
|
||||
let parent = import.parent();
|
||||
|
||||
resolve_module(self.db, import)
|
||||
resolve_module(self.db, &import)
|
||||
.map(|module| module.file().path(self.db))
|
||||
.or_else(|| {
|
||||
// Attempt to resolve the module (e.g., given `from foo import bar`, look for `foo`).
|
||||
|
||||
resolve_module(self.db, parent?).map(|module| module.file().path(self.db))
|
||||
resolve_module(self.db, &parent?).map(|module| module.file().path(self.db))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue