[PATCH] D72777: [clangd] Dont display `<unknown>` kinds in hover board
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 15 09:15:46 PST 2020
kadircet created this revision.
kadircet added a reviewer: usaxena95.
Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.
Currently when hovering over an `auto` or `decltype` that resolve to a
builtin-type, clangd would display `<unknown>` as the kind of the symbol.
Drop that to make rendering nicer.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72777
Files:
clang-tools-extra/clangd/Hover.cpp
clang-tools-extra/clangd/unittests/HoverTests.cpp
Index: clang-tools-extra/clangd/unittests/HoverTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/HoverTests.cpp
+++ clang-tools-extra/clangd/unittests/HoverTests.cpp
@@ -1655,7 +1655,7 @@
HI.Kind = index::SymbolKind::Unknown;
HI.Name = "X";
},
- R"(<unknown> X)",
+ R"(X)",
},
{
[](HoverInfo &HI) {
Index: clang-tools-extra/clangd/Hover.cpp
===================================================================
--- clang-tools-extra/clangd/Hover.cpp
+++ clang-tools-extra/clangd/Hover.cpp
@@ -522,7 +522,8 @@
// level 1 and 2 headers in a huge font, see
// https://github.com/microsoft/vscode/issues/88417 for details.
markup::Paragraph &Header = Output.addHeading(3);
- Header.appendText(index::getSymbolKindString(Kind));
+ if (Kind != index::SymbolKind::Unknown)
+ Header.appendText(index::getSymbolKindString(Kind));
assert(!Name.empty() && "hover triggered on a nameless symbol");
Header.appendCode(Name);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72777.238289.patch
Type: text/x-patch
Size: 1078 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200115/a45552d0/attachment.bin>
More information about the cfe-commits
mailing list