Skip to content

Commit e71cef8

Browse files
committed
Merge 'upstream': fix: prevent mason setup from being run twice
2 parents 5f3310d + db4867a commit e71cef8

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

lua/kickstart/plugins/lspconfig.lua

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ return {
1818
'neovim/nvim-lspconfig',
1919
dependencies = {
2020
-- Automatically install LSPs and related tools to stdpath for Neovim
21-
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
21+
-- Mason must be loaded before its dependents so we need to set it up here.
22+
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
23+
{ 'williamboman/mason.nvim', opts = {} },
2224
'williamboman/mason-lspconfig.nvim',
2325
'WhoIsSethDaniel/mason-tool-installer.nvim',
2426

@@ -207,13 +209,16 @@ return {
207209
}
208210

209211
-- Ensure the servers and tools above are installed
210-
-- To check the current status of installed tools and/or manually install
211-
-- other tools, you can run
212+
--
213+
-- To check the current status of installed tools and/or manually install
214+
-- other tools, you can run
212215
-- :Mason
213216
--
214-
-- You can press `g?` for help in this menu.
215-
require('mason').setup()
216-
217+
-- You can press `g?` for help in this menu.
218+
--
219+
-- `mason` had to be setup earlier: to configure its options see the
220+
-- `dependencies` table for `nvim-lspconfig` above.
221+
--
217222
-- You can add other tools here that you want Mason to install
218223
-- for you, so that they are available from within Neovim.
219224
local ensure_installed = vim.tbl_keys(servers or {})

0 commit comments

Comments
 (0)