refactor(completion): evolve Request into Session + surface-level cleanup
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
local MAX_WIDTH = 80
|
||||
local MAX_HEIGHT = 20
|
||||
local HALF_HEIGHT = math.floor(MAX_HEIGHT / 2)
|
||||
local SNIPPET_KIND = vim.lsp.protocol.CompletionItemKind.Snippet
|
||||
|
||||
local NS = vim.api.nvim_create_namespace("ow.lsp.completion.popup")
|
||||
|
||||
@@ -28,14 +29,15 @@ end
|
||||
---@return integer? width
|
||||
local function build_content(item, ft)
|
||||
local sections = {}
|
||||
if item.detail then
|
||||
table.insert(sections, fence(ft, item.detail))
|
||||
end
|
||||
if item.snippet then
|
||||
if item.snippet and item.raw.kind == SNIPPET_KIND then
|
||||
table.insert(sections, fence(ft, item.snippet))
|
||||
end
|
||||
if item.doc then
|
||||
table.insert(sections, item.doc)
|
||||
else
|
||||
if item.detail then
|
||||
table.insert(sections, fence(ft, item.detail))
|
||||
end
|
||||
if item.doc then
|
||||
table.insert(sections, item.doc)
|
||||
end
|
||||
end
|
||||
if #sections == 0 then
|
||||
return nil, nil
|
||||
|
||||
Reference in New Issue
Block a user