@@ -457,7 +457,9 @@ require('lazy').setup({
457457 ' neovim/nvim-lspconfig' ,
458458 dependencies = {
459459 -- Automatically install LSPs and related tools to stdpath for Neovim
460- { ' williamboman/mason.nvim' , config = true }, -- NOTE: Must be loaded before dependants
460+ -- Mason must be loaded before its dependents so we need to set it up here.
461+ -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
462+ { ' williamboman/mason.nvim' , opts = {} },
461463 ' williamboman/mason-lspconfig.nvim' ,
462464 ' WhoIsSethDaniel/mason-tool-installer.nvim' ,
463465
@@ -646,13 +648,16 @@ require('lazy').setup({
646648 }
647649
648650 -- Ensure the servers and tools above are installed
649- -- To check the current status of installed tools and/or manually install
650- -- other tools, you can run
651+ --
652+ -- To check the current status of installed tools and/or manually install
653+ -- other tools, you can run
651654 -- :Mason
652655 --
653- -- You can press `g?` for help in this menu.
654- require (' mason' ).setup ()
655-
656+ -- You can press `g?` for help in this menu.
657+ --
658+ -- `mason` had to be setup earlier: to configure its options see the
659+ -- `dependencies` table for `nvim-lspconfig` above.
660+ --
656661 -- You can add other tools here that you want Mason to install
657662 -- for you, so that they are available from within Neovim.
658663 local ensure_installed = vim .tbl_keys (servers or {})
0 commit comments