[PATCH] D55250: [clangd] Enhance macro hover to see full definition

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 19 04:40:46 PST 2019


ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdLSPServer.cpp:823
+              (*H)->contents.value =
+                  llvm::formatv("```C++\n{0}\n```", (*H)->contents.value);
+            }
----------------
The contents of the hover is not strictly C++ code, so we shouldn't put the whole block into the C++ code.
Could we return the plain text results for now? The hover implementation should probably create markdown (or some other form of formatted text) on its own, but that's out of scope of this patch.


================
Comment at: clangd/Protocol.h:378
+  /// textDocument.hover.contentFormat.
+  llvm::Optional<MarkupKindBitset> HoverMarkupKinds;
 };
----------------
Could we replace this with a single boolean to simplify the code?
```
bool HoverSupportsMarkdown = false;
```

Would also allow to get remove `MarkupKindBitset`.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D55250





More information about the cfe-commits mailing list