Skip to content

Commit b08e835

Browse files
committed
[clangd] Dont display <unknown> kinds in hover board
Summary: 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. Reviewers: usaxena95 Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72777
1 parent 0b21d55 commit b08e835

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang-tools-extra/clangd/Hover.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ markup::Document HoverInfo::present() const {
522522
// level 1 and 2 headers in a huge font, see
523523
// https://github.com/microsoft/vscode/issues/88417 for details.
524524
markup::Paragraph &Header = Output.addHeading(3);
525-
Header.appendText(index::getSymbolKindString(Kind));
525+
if (Kind != index::SymbolKind::Unknown)
526+
Header.appendText(index::getSymbolKindString(Kind));
526527
assert(!Name.empty() && "hover triggered on a nameless symbol");
527528
Header.appendCode(Name);
528529

clang-tools-extra/clangd/unittests/HoverTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ TEST(Hover, Present) {
16551655
HI.Kind = index::SymbolKind::Unknown;
16561656
HI.Name = "X";
16571657
},
1658-
R"(<unknown> X)",
1658+
R"(X)",
16591659
},
16601660
{
16611661
[](HoverInfo &HI) {

0 commit comments

Comments
 (0)