[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 21:11:29 PDT 2024


https://github.com/HighCommander4 requested changes to this pull request.

Thanks for the updated patch, this generally looks very nice!

It's a bit unfortunate that we have to reimplement parts of type printing like handling qualifiers and pointers/references. I wouldn't be surprised if we get some edge cases wrong compared to `TypePrinter`. However, I don't have a better idea currently (other than invasive changes like adding extension points to `TypePrinter`), and I find two things reassuring:

 1. Our existing `TypeHints.*` tests exercise the type printing logic of this class, so we know we are not regressing those cases.
 2. If we do regress some edge cases, it's not a big problem, since this feature is just a reading aid and not something critical to correctness.

So, I think it's fine to go with this approach. Thanks for all your efforts putting this together, and sorry it took me this long to get around to revieiwng the implementation!

https://github.com/llvm/llvm-project/pull/86629


More information about the cfe-commits mailing list