refactor: fix config type annotations
This commit is contained in:
parent
7c198a1b36
commit
d1eaebab6b
3 changed files with 8 additions and 8 deletions
|
|
@ -44,12 +44,6 @@ to install them synchronously pass `{sync = true}` as an argument.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
------------------------------------------------------------------------------
|
|
||||||
*config*
|
|
||||||
`config`
|
|
||||||
Type ~
|
|
||||||
`(gopher.Config)`
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*gopher.nvim-config*
|
*gopher.nvim-config*
|
||||||
`default_config`
|
`default_config`
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
---@type gopher.Config
|
||||||
|
---@dochide
|
||||||
|
---@diagnostic disable-next-line: missing-fields .setup() gets injected later
|
||||||
local config = {}
|
local config = {}
|
||||||
|
|
||||||
---@tag gopher.nvim-config.ConfigGoTagTransform
|
---@tag gopher.nvim-config.ConfigGoTagTransform
|
||||||
|
|
@ -16,6 +19,7 @@ local config = {}
|
||||||
---@tag gopher.nvim-config
|
---@tag gopher.nvim-config
|
||||||
---@eval return MiniDoc.afterlines_to_code(MiniDoc.current.eval_section)
|
---@eval return MiniDoc.afterlines_to_code(MiniDoc.current.eval_section)
|
||||||
---@class gopher.Config
|
---@class gopher.Config
|
||||||
|
---@field setup fun(user_config?: gopher.Config)
|
||||||
local default_config = {
|
local default_config = {
|
||||||
-- log level, you might consider using DEBUG or TRACE for debugging the plugin
|
-- log level, you might consider using DEBUG or TRACE for debugging the plugin
|
||||||
---@type number
|
---@type number
|
||||||
|
|
@ -112,5 +116,4 @@ setmetatable(config, {
|
||||||
})
|
})
|
||||||
|
|
||||||
---@dochide
|
---@dochide
|
||||||
---@return gopher.Config
|
return config
|
||||||
return config --[[ @as gopher.Config ]]
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,14 @@ config["can be called without any arguments passed"] = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
config["can be called with empty table"] = function()
|
config["can be called with empty table"] = function()
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
require("gopher").setup {}
|
require("gopher").setup {}
|
||||||
end
|
end
|
||||||
|
|
||||||
config["should change option"] = function()
|
config["should change option"] = function()
|
||||||
local log_level = 1234567890
|
local log_level = 1234567890
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
require("gopher").setup {
|
require("gopher").setup {
|
||||||
log_level = log_level,
|
log_level = log_level,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue