diff --git a/lua/astrolsp/config.lua b/lua/astrolsp/config.lua index 8d85f19..0343ee1 100644 --- a/lua/astrolsp/config.lua +++ b/lua/astrolsp/config.lua @@ -8,6 +8,7 @@ -- @copyright 2023 -- @license GNU General Public License v3.0 +---@type AstroLSPConfig return { --- Configuration table of features provided by AstroLSP -- @usage features = { diff --git a/lua/astrolsp/init.lua b/lua/astrolsp/init.lua index a847f9c..26ca0b6 100644 --- a/lua/astrolsp/init.lua +++ b/lua/astrolsp/init.lua @@ -243,7 +243,7 @@ function M.lsp_opts(server_name) end --- Setup and configure AstroLSP ----@param opts table options passed by the user to configure AstroLSP +---@param opts AstroLSPConfig options passed by the user to configure AstroLSP -- @see astrolsp.config function M.setup(opts) M.config = vim.tbl_deep_extend("force", M.config, opts) diff --git a/lua/astrolsp/types.lua b/lua/astrolsp/types.lua new file mode 100644 index 0000000..e2b4505 --- /dev/null +++ b/lua/astrolsp/types.lua @@ -0,0 +1,32 @@ +---@meta + +---@class AstroLSPFeatureOpts +---@field autoformat boolean? +---@field codelens boolean? +---@field diagnostics_mode integer? +---@field inlay_hints boolean? +---@field lsp_handlers boolean? +---@field semantic_tokens boolean? + +---@class AstroLSPFormatOnSaveOpts +---@field enabled boolean +---@field allow_filetypes string[]? +---@field ignore_filetypes string[]? + +---@class AstroLSPFormatOpts +---@field format_on_save boolean|AstroLSPFormatOnSaveOpts? +---@field disabled string[]? +---@field timeout_ms integer? +---@field filter fun(client):boolean? + +---@class AstroLSPConfig +---@field features AstroLSPFeatureOpts? +---@field capabilities table? +---@field config lspconfig.options? +---@field diagnostics table? +---@field flags table? +---@field formatting AstroLSPFormatOpts? +---@field handlers table? +---@field mappings table>? +---@field servers string[]? +---@field on_attach fun(client,bufnr)?