diff options
author | Qingyuan Zheng <qyzheng2@outlook.com> | 2022-09-07 17:44:32 +0200 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2022-09-07 17:49:45 +0200 |
commit | 44bbf20965d2c1e00bb805343ad80dbb7758bf3d (patch) | |
tree | e6f702012f3c1d3c2ee0eca829dabcc3fc7f3227 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | a1c4dedd34d0d227dacf968838a804b635fc6cec (diff) | |
download | llvm-44bbf20965d2c1e00bb805343ad80dbb7758bf3d.zip llvm-44bbf20965d2c1e00bb805343ad80dbb7758bf3d.tar.gz llvm-44bbf20965d2c1e00bb805343ad80dbb7758bf3d.tar.bz2 |
[clangd] Add Macro Expansion to Hover
This patch adds macro expansion preview to hover info. Basically, the refactor infrastructure for expanding macro is used for this purpose. The following steps are added to getHoverContents for macros:
1. calling AST.getTokens().expansionStartingAt(...) to get expanded tokens
2. calling reformat(...) to format expanded tokens
Some opinions are wanted:
1. Should we present macro expansion before definition in the hover card?
2. Should we truncate/ignore macro expansion if it's too long? For performance and presentation reason, it might not be a good idea to expand pages worth of tokens in hover card. If so, what's the preferred threshold?
Also, some limitation applies:
1. Expansion isn't available in macro definition/arguments as the refactor code action isn't either.
Differential Revision: https://reviews.llvm.org/D127082
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions