[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
This commit is contained in:
Kadir Cetinkaya 2020-01-15 18:09:51 +01:00
parent 0b21d55262
commit b08e8353a8
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
2 changed files with 3 additions and 2 deletions

View File

@ -522,7 +522,8 @@ markup::Document HoverInfo::present() const {
// 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);

View File

@ -1655,7 +1655,7 @@ TEST(Hover, Present) {
HI.Kind = index::SymbolKind::Unknown;
HI.Name = "X";
},
R"(<unknown> X)",
R"(X)",
},
{
[](HoverInfo &HI) {