From 304d1cc0fa4be1dcf96fd7500abcc12d06f54a23 Mon Sep 17 00:00:00 2001 From: AstroNvim Bot Date: Thu, 30 Jan 2025 15:41:50 +0000 Subject: [PATCH] chore(build): auto-generate vimdoc --- doc/astrolsp.txt | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/astrolsp.txt b/doc/astrolsp.txt index a126980..d36e313 100644 --- a/doc/astrolsp.txt +++ b/doc/astrolsp.txt @@ -1,4 +1,4 @@ -*astrolsp.txt* For Neovim >= 0.9.0 Last change: 2025 January 19 +*astrolsp.txt* For Neovim >= 0.9.0 Last change: 2025 January 30 ============================================================================== Table of Contents *astrolsp-table-of-contents* @@ -208,6 +208,21 @@ Here are descriptions of the options and some example usages: }, }, }, + -- Extra configuration for the `mason-lspconfig.nvim` plugin + mason_lspconfig = { + -- Allow registering more Mason packages as language servers for autodetection/setup + servers = { + -- The key is the lspconfig server name to register a package for + nextflow_ls = { + -- The Mason package name to register to the language server + package = "nextflow-language-server", + -- The filetypes that apply to the package and language server + filetypes = { "nextflow" }, + -- (Optional) any default configuration changes that may need to happen (can be a table or a function that returns a table) + config = { cmd = { "nextflow-language-server" } } + } + } + } -- A list like table of servers that should be setup, useful for enabling language servers not installed with Mason. servers = { "dartls" }, -- A custom `on_attach` function to be run after the default `on_attach` function, takes two parameters `client` and `bufnr` (`:h lspconfig-setup`) @@ -251,12 +266,16 @@ NVIM-LSPCONFIG + MASON.NVIM + MASON-LSPCONFIG.NVIM ~ { "williamboman/mason-lspconfig.nvim", -- MUST be set up before `nvim-lspconfig` dependencies = { "williamboman/mason.nvim" }, - opts = function() - return { - -- use AstroLSP setup for mason-lspconfig - handlers = { function(server) require("astrolsp").lsp_setup(server) end }, - } - end, + opts = { + -- use AstroLSP setup for mason-lspconfig + handlers = { function(server) require("astrolsp").lsp_setup(server) end }, + }, + config = function(_, opts) + -- Optionally tell AstroLSP to register new language servers before calling the `setup` function + -- this enables the `mason-lspconfig.servers` option in the AstroLSP configuration + require("astrolsp.mason-lspconfig").register_servers() + require("mason-lspconfig").setup(opts) + end }, }, config = function()