[PATCH] D137650: [clangd] Implement hover for string literals

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 9 08:13:37 PST 2022


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/Hover.cpp:816
+  if (llvm::isa<StringLiteral>(E)) {
+    HoverInfo::PrintedType PT;
+    PT.Type = E->getType().getAsString(PP);
----------------
can you extract this into a function, similar to the cases below?


================
Comment at: clang-tools-extra/clangd/Hover.cpp:819
+    HI.Type = PT;
+    HI.Name = "String Literal";
+    return HI;
----------------
i think it's a good idea to also include the size here (e.g. L"XYZ", would be 8 bytes).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137650



More information about the cfe-commits mailing list