[mirror] Make your go dev experience better github.com/olexsmir/gopher.nvim
neovim golang

refactor: fix config type annotations

olexsmir.xyz d1eaebab 7c198a1b

verified
Changed files
+8 -8
doc
lua
gopher
spec
-6
doc/gopher.nvim.txt
··· 45 45 46 46 ============================================================================== 47 47 ------------------------------------------------------------------------------ 48 - *config* 49 - `config` 50 - Type ~ 51 - `(gopher.Config)` 52 - 53 - ------------------------------------------------------------------------------ 54 48 *gopher.nvim-config* 55 49 `default_config` 56 50 >lua
+5 -2
lua/gopher/config.lua
··· 1 + ---@type gopher.Config 2 + ---@dochide 3 + ---@diagnostic disable-next-line: missing-fields .setup() gets injected later 1 4 local config = {} 2 5 3 6 ---@tag gopher.nvim-config.ConfigGoTagTransform ··· 16 19 ---@tag gopher.nvim-config 17 20 ---@eval return MiniDoc.afterlines_to_code(MiniDoc.current.eval_section) 18 21 ---@class gopher.Config 22 + ---@field setup fun(user_config?: gopher.Config) 19 23 local default_config = { 20 24 -- log level, you might consider using DEBUG or TRACE for debugging the plugin 21 25 ---@type number ··· 112 116 }) 113 117 114 118 ---@dochide 115 - ---@return gopher.Config 116 - return config --[[ @as gopher.Config ]] 119 + return config
+3
spec/unit/config_test.lua
··· 7 7 end 8 8 9 9 config["can be called with empty table"] = function() 10 + ---@diagnostic disable-next-line: missing-fields 10 11 require("gopher").setup {} 11 12 end 12 13 13 14 config["should change option"] = function() 14 15 local log_level = 1234567890 16 + 17 + ---@diagnostic disable-next-line: missing-fields 15 18 require("gopher").setup { 16 19 log_level = log_level, 17 20 }