[PATCH] D127082: [clangd] Add Macro Expansion to Hover
Qingyuan Zheng via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 23 18:31:36 PDT 2022
daiyousei-qz added a comment.
Sorry I'm a little occupied lately.
Regarding to the order of `Definition` and `MacroExpansion`, I experimented putting expansion first and noticed the following:
1. Short definition and short expansion: order doesn't matter, it's always clear
2. Short definition and long expansion: putting definition first may have advantage in providing a general overview about the macro
3. Long definition and long expansion: hover card isn't a great place to read even if it's scrollable. I'd rather jump to definition or use refactor feature to expand the macro in place :(
Therefore, I still put definition in front of the expansion in this update.
Regarding to the size limit of expansion:
Here I'm using a 2048 bytes buffer. If exceeded, no macro expansion will be displayed. It might be hard to limit size in term of lines because the expanded segment of code will be reformated.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits