Codesearch Sometimes Resolves Class Names to Interface Definitions #12530
Replies: 1 comment
-
Hey! Thanks for the report. What's going on here is definitely confusing... the context chooser is trying to find something relevant to show. There is an implementation (as you point out, not a great one) in the file you're on, and the heuristics strongly prefer things from the same file, so it shows that, even though showing the definition would make more sense. Note that the type TyCtxt is defined in https://cs.github.com/rust-lang/rust/blob/ecb867ec3cefa97a5807453a68758392730e3ed9/compiler/rustc_middle/src/ty/context.rs#L1003. If you click on it in that file, it shows the type definition as you'd expect. I think tweaking the heuristics might help it do the right thing here. I'll post an update when it's working a bit better |
Beta Was this translation helpful? Give feedback.
-
There appears to be a problem where codesearch sometimes resolves class usages as usages of an interface that class implements.
When I click on
TyCtxt
on this line, the sidebar points toimpl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx>
, even though this usage ofTyCtxt
doesn't necessarily have anything to do withTyCtxtInferExt
.Furthermore, from the sidebar that pops up, there is no obvious way of navigating to either the class/struct definition (that is,
TyCtxt
's definition) or the interface/trait definition (that is,TyCtxtInferExt
's definition). There does not seem to be a way to navigate to these definitions, even by clicking on them in theimpl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx>
line. This could be considered a seperate bug/feature request; let me know if I should file a seperate discussion.Beta Was this translation helpful? Give feedback.
All reactions