fix(dap.hover): format non-value nodes without =

This commit is contained in:
2025-09-28 15:55:16 +02:00
parent 5f90120f44
commit 39c1aac2a7
+10 -10
View File
@@ -92,12 +92,16 @@ function Node:format_c()
) )
end end
return string.format( if self.item.value == "" then
"%s %s = %s", return string.format("%s %s", self.item.type, self.item.name)
self.item.type, else
self.item.name, return string.format(
self.item.value "%s %s = %s",
) self.item.type,
self.item.name,
self.item.value
)
end
end end
---@return boolean ---@return boolean
@@ -127,10 +131,6 @@ function Node:format_into(content)
end end
content:add_with_treesitter(text, self.lang) content:add_with_treesitter(text, self.lang)
if self.item.value == "" then
content:add("...", "@comment")
end
end end
return Node return Node