chore: add type annotations to (almost) all functions

This commit is contained in:
Akmadan23
2023-11-24 12:01:24 +01:00
parent 46e1f776f0
commit fabea3376e
48 changed files with 438 additions and 83 deletions

View File

@@ -1,8 +1,8 @@
local M = {}
--- Apply mappings to a scratch buffer and return buffer local mappings
--- @param fn function(bufnr) on_attach or default_on_attach
--- @return table as per vim.api.nvim_buf_get_keymap
---@param fn function(bufnr) on_attach or default_on_attach
---@return table as per vim.api.nvim_buf_get_keymap
local function generate_keymap(fn)
-- create an unlisted scratch buffer
local scratch_bufnr = vim.api.nvim_create_buf(false, true)
@@ -93,10 +93,12 @@ function M.default_on_attach(bufnr)
end
-- stylua: ignore end
---@return table
function M.get_keymap()
return generate_keymap(M.on_attach)
end
---@return table
function M.get_keymap_default()
return generate_keymap(M.default_on_attach)
end