feat(lsp): add snippet support and refactor completion into Item class

This commit is contained in:
2026-04-17 00:03:03 +02:00
parent 5ecec7cc6c
commit 47f36adc21
9 changed files with 213 additions and 144 deletions
+2 -6
View File
@@ -25,7 +25,7 @@ end, REFRESH_DEBOUNCE_MS)
---@class ow.lsp.codelens.Row
---@field row integer
---@field ready lsp.CodeLens[]
---@field pending integer count of unresolved lenses still in flight
---@field pending integer
local Row = {}
Row.__index = Row
@@ -44,7 +44,7 @@ function Row:await()
self.pending = self.pending + 1
end
---@param resolved lsp.CodeLens?
---@param resolved? lsp.CodeLens
function Row:resolved(resolved)
self.pending = self.pending - 1
if resolved then
@@ -52,9 +52,6 @@ function Row:resolved(resolved)
end
end
--- Paint this row's extmark. Preserves the previous extmark while any lens
--- on the row is still resolving so the user doesn't see a partial row
--- (e.g. "refs" without "impls").
---@param buf integer
function Row:render(buf)
if not vim.api.nvim_buf_is_valid(buf) then
@@ -161,7 +158,6 @@ function State.new(buf)
}, State)
end
--- Paint every row and drop extmarks on rows that are no longer present.
function State:render()
if not vim.api.nvim_buf_is_valid(self.buf) then
return