Skip to content

Commit

Permalink
LSP: fixed hover tooltip in case of empty value
Browse files Browse the repository at this point in the history
  • Loading branch information
Freaxed committed Feb 23, 2024
1 parent b6ad811 commit b2e9318
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lsp-client/LSPEditorWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,18 @@ LSPEditorWrapper::_ShowToolTip(const char* text)
void
LSPEditorWrapper::_DoHover(nlohmann::json& result)
{
if (result == nlohmann::detail::value_t::null) {
if (result == nlohmann::detail::value_t::null &&
!result["contents"].contains("value")) {
EndHover();
return;
}

std::string tip = result["contents"]["value"].get<std::string>();

if (tip.empty()) {
EndHover();
return;
}
_ShowToolTip(tip.c_str());
}

Expand Down

0 comments on commit b2e9318

Please sign in to comment.