use only the first filetype when formatting (#857)

This commit is contained in:
Eric
2022-03-28 17:22:45 +08:00
committed by GitHub
parent 2dff6a8b60
commit dd6e4d96f9

View File

@@ -411,9 +411,14 @@ entry.get_documentation = function(self)
-- detail
if misc.safe(item.detail) and item.detail ~= '' then
local ft = self.context.filetype
local dot_index = string.find(ft, "%.")
if dot_index ~= nil then
ft = string.sub(ft, 0, dot_index-1)
end
table.insert(documents, {
kind = types.lsp.MarkupKind.Markdown,
value = ('```%s\n%s\n```'):format(self.context.filetype, str.trim(item.detail)),
value = ('```%s\n%s\n```'):format(ft, str.trim(item.detail)),
})
end