I’d like an API like
Semantics::resolve_path, but which would accept a path not obtained from
Semantics. Supplied paths would all be absolute. Any thoughts on how such an API should look? I just prototyped with a variant
fn resolve_path_at(&self, path: &ast::Path, context: &SyntaxNode) -> Option<PathResolution>. My use-case is for adding type constraints on SSR placeholders.
something like that should probably take a HIR path, not an AST path. If the path is always absolute it might be enough to also pass a
Crate as context, or maybe it could be a method on
although there's also already
so... actually I think that should be what you're looking for?
Ah, you're right. That does do what I was after. Thanks!