[PATCH] D116387: [CodeCompletion][clangd] Clean __uglified parameter names in completion & hover

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 10 02:52:15 PST 2022


hokein added a comment.

Agree that __ reserved names are ugly,  but I'm not sure this is a great improvement.

I played around the patch locally, and found the new behavior being confused in some cases (mostly inconsistencies between deuglified places vs uglified places), and seems hard for readers to predict it:

- inconsistency with doc-comment which still uses the __ name (this seems hard to fix)

F21562126: image.png <https://reviews.llvm.org/F21562126>

- the print type in hover still uses __name (maybe this is expected, or we could introduce a `reserved` field in hover, like `template-type-param Tp (reserved)`)

F21562145: image.png <https://reviews.llvm.org/F21562145>

- the deuglified behavior is triggered on (template/function) parameters, which means we have uglified name for `void foo(_ReservedClass& abc)` vs deuglified name for `template<typename _ReservedClass> void foo(_ReservedClass& abc)` (expanding the scope could fix that, but it doesn't seem something we want to do)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116387/new/

https://reviews.llvm.org/D116387



More information about the cfe-commits mailing list