Skip to content

Commit

Permalink
feat: add type annotations for modules
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Nov 14, 2024
1 parent 9521fe8 commit ac5aba6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local config = Config.config
local api = vim.api
local uv = vim.uv or vim.loop

--- @class gitsigns.main
local M = {}

local cwd_watcher ---@type uv.uv_fs_event_t?
Expand Down Expand Up @@ -222,7 +223,8 @@ function M.setup(cfg)
setup_cwd_head()
end

return setmetatable(M, {
--- @type gitsigns.main|gitsigns.actions|gitsigns.attach|gitsigns.debug
M = setmetatable(M, {
__index = function(_, f)
local attach = require('gitsigns.attach')
if attach[f] then
Expand All @@ -242,3 +244,5 @@ return setmetatable(M, {
end
end,
})

return M
1 change: 1 addition & 0 deletions lua/gitsigns/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local cache = require('gitsigns.cache').cache
local api = vim.api
local current_buf = api.nvim_get_current_buf

--- @class gitsigns.actions
local M = {}

--- @class Gitsigns.CmdParams.Smods
Expand Down
1 change: 1 addition & 0 deletions lua/gitsigns/attach.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local throttle_by_id = require('gitsigns.debounce').throttle_by_id
local api = vim.api
local uv = vim.loop

--- @class gitsigns.attach
local M = {}

--- @param name string
Expand Down
1 change: 1 addition & 0 deletions lua/gitsigns/debug.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local log = require('gitsigns.debug.log')

--- @class gitsigns.debug
local M = {}

--- @param raw_item any
Expand Down

0 comments on commit ac5aba6

Please sign in to comment.