This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Always desugar type aliases in hover
ClosedPublic

Authored by kadircet on Jun 15 2022, 1:06 AM.

Details

Summary

The alias itself is already included in the definition section of the
hover (it's printed as spelled in source code). So it doesn't provide any value
when we print the aliases as-is.
Fixes https://github.com/clangd/clangd/issues/1134.

Diff Detail

Event Timeline

kadircet created this revision.Jun 15 2022, 1:06 AM
kadircet requested review of this revision.Jun 15 2022, 1:06 AM
ilya-biryukov accepted this revision.Jun 15 2022, 3:57 AM

LGTM. Please take a look the NIT about landing this as two commits.

clang-tools-extra/clangd/Hover.cpp
581

NIT: maybe use auto& here?
The name of the type is mentioned directly in the initialization.

626–627

NIT: could you please land the refactoring with ASTContext and this change separately?
It was a bit hard to find the relevant change for me, I suspect reading the git history might also be problematic in the future.

This revision is now accepted and ready to land.Jun 15 2022, 3:57 AM
kadircet updated this revision to Diff 437148.Jun 15 2022, 7:09 AM
kadircet marked 2 inline comments as done.
  • Leave the Ctx refactoring out of the patch.
This revision was landed with ongoing or failed builds.Jun 15 2022, 7:13 AM
This revision was automatically updated to reflect the committed changes.