[clangd] Support macro evaluation on hover
authorYounan Zhang <zyn7109@gmail.com>
Sun, 16 Apr 2023 07:35:04 +0000 (15:35 +0800)
committerYounan Zhang <zyn7109@gmail.com>
Tue, 9 May 2023 10:50:27 +0000 (18:50 +0800)
commit7385cc389abad29eb9044d260b23dd483d674718
treedde5c16aacf043a1afb9f17f98bce2ae4a1900cb
parent93ac2dbefcab039545d04e46f22e29e87013234c
[clangd] Support macro evaluation on hover

Creating a SelectionTree at the location where macro expands allows
us to obtain the associated expression, which might then be used to
evaluate compile-time values if possible.

Closes clangd/clangd#1595.

Reviewed By: nridge

Differential Revision: https://reviews.llvm.org/D148457
clang-tools-extra/clangd/Hover.cpp
clang-tools-extra/clangd/unittests/HoverTests.cpp