LSP: Don't serialize empty documentation

This commit is contained in:
HolonProduction 2025-04-13 17:06:26 +02:00
parent 2327a82357
commit e7c01f8427

View file

@ -1077,8 +1077,12 @@ struct CompletionItem {
dict["insertText"] = insertText;
}
if (resolved) {
dict["detail"] = detail;
dict["documentation"] = documentation.to_json();
if (!detail.is_empty()) {
dict["detail"] = detail;
}
if (!documentation.value.is_empty()) {
dict["documentation"] = documentation.to_json();
}
dict["deprecated"] = deprecated;
dict["preselect"] = preselect;
if (!sortText.is_empty()) {