Skip to content

Commit a75a3a8

Browse files
committed
fix: migrate to using mason-tool-installer.nvim for all Mason package management
1 parent d5ac954 commit a75a3a8

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

src/content/docs/configuration/customizing_plugins.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ The `table` notation is the simplest method for configuration but does not cover
123123

124124
:::tip
125125

126-
Since [`lazy.nvim` v10.23.0](https://github.com/folke/lazy.nvim/releases/tag/v10.23.0) a new configuration option has been added called `opts_extend` which allows specifying that a part of the options passed to the `opts` table should be treated as a list that is extended rather than replaced completely as described below. Since [AstroNvim v4.9.0](https://github.com/AstroNvim/AstroNvim/releases/tag/v4.9.0) this option has been enabled out of the box for the `ensure_installed` tables for the following plugins: [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter), [`mason-lspconfig.nvim`](https://github.com/williamboman/mason-lspconfig.nvim), [`mason-null-ls.nvim`](https://github.com/jay-babu/mason-null-ls.nvim), and [`mason-nvim-dap.nvim`](https://github.com/jay-babu/mason-nvim-dap.nvim). This allows the user to use the basic table notation to simply add more items to these `ensure_installed` lists.
126+
Since [`lazy.nvim` v10.23.0](https://github.com/folke/lazy.nvim/releases/tag/v10.23.0) a new configuration option has been added called `opts_extend` which allows specifying that a part of the options passed to the `opts` table should be treated as a list that is extended rather than replaced completely as described below. Since [AstroNvim v4.9.0](https://github.com/AstroNvim/AstroNvim/releases/tag/v4.9.0) this option has been enabled out of the box for the `ensure_installed` tables for [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter) and [`mason-tool-installer.nvim`](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim). This allows the user to use the basic table notation to simply add more items to these `ensure_installed` lists.
127127

128128
:::
129129

src/content/docs/recipes/advanced_lsp.mdx

+10-10
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ return {
7171

7272
### LSP Setup Without Installer
7373

74-
AstroNvim comes with [mason-lspconfig](https://github.com/williamboman/mason-lspconfig.nvim) as an easy interface for setting up and installing language servers, but this might not be adequate for all users. The LSP installer doesn't support all of the language servers that Neovim's LSP config supports and some users may already have the language servers installed on their machine and don't want to reinstall it separately. In these cases we have added an easy interface for setting up these servers. The following plugin specification for AstroLSP simply sets up `pyright` language server for a user with `pyright` already available on their system:
74+
AstroNvim comes with [mason-lspconfig](https://github.com/williamboman/mason-lspconfig.nvim) as an easy interface for setting up language servers installed with Mason, but this might not be adequate for all users. The LSP installer doesn't support all of the language servers that Neovim's LSP config supports and some users may already have the language servers installed on their machine and don't want to reinstall it separately. In these cases we have added an easy interface for setting up these servers. The following plugin specification for AstroLSP simply sets up `pyright` language server for a user with `pyright` already available on their system:
7575

7676
```lua title="lua/plugins/astrolsp.lua" {7-12}
7777
return {
@@ -278,7 +278,7 @@ Many of these can be found pre-configured in the [AstroNvim Community Repository
278278

279279
:::
280280

281-
There are some plugins available for doing advanced setup of language servers that require the user to not use the `lspconfig` setup call and instead use their own plugin setup for handling this. AstroNvim provides a nice way to do this while still using `mason-lspconfig` for installing the language servers. You can use the `setup_handlers` table for specifying how language servers should be setup such as using a language specific plugin. This function for each handler has two parameters, the first is the name of the server and the second is the options we would be passing to the `lspconfig` setup call. These options include things such as our built in `capabilities`, `on_attach`, as well as the user defined options in the `config` table. Here are a couple examples for some common LSP plugins:
281+
There are some plugins available for doing advanced setup of language servers that require the user to not use the `lspconfig` setup call and instead use their own plugin setup for handling this. AstroNvim provides a nice way to do this while still using `mason.nvim` for installing the language servers. You can use the `setup_handlers` table for specifying how language servers should be setup such as using a language specific plugin. This function for each handler has two parameters, the first is the name of the server and the second is the options we would be passing to the `lspconfig` setup call. These options include things such as our built in `capabilities`, `on_attach`, as well as the user defined options in the `config` table. Here are a couple examples for some common LSP plugins:
282282

283283
### Typescript ([typescript.nvim](https://github.com/jose-elias-alvarez/typescript.nvim))
284284

@@ -311,9 +311,9 @@ return {
311311
},
312312
},
313313
{
314-
"williamboman/mason-lspconfig.nvim",
314+
"WhoIsSethDaniel/mason-tool-installer.nvim",
315315
opts = {
316-
ensure_installed = { "tsserver" }, -- automatically install lsp
316+
ensure_installed = { "typescript-language-server" }, -- automatically install lsp
317317
},
318318
},
319319
}
@@ -350,9 +350,9 @@ return {
350350
},
351351
},
352352
{
353-
"williamboman/mason-lspconfig.nvim",
353+
"WhoIsSethDaniel/mason-tool-installer.nvim",
354354
opts = {
355-
ensure_installed = { "denols" }, -- automatically install lsp
355+
ensure_installed = { "deno" }, -- automatically install lsp
356356
},
357357
},
358358
}
@@ -506,7 +506,7 @@ return {
506506
end,
507507
},
508508
{
509-
"williamboman/mason-lspconfig.nvim",
509+
"WhoIsSethDaniel/mason-tool-installer.nvim",
510510
opts = {
511511
ensure_installed = { "clangd" }, -- automatically install lsp
512512
},
@@ -597,9 +597,9 @@ return {
597597
},
598598
},
599599
{
600-
"williamboman/mason-lspconfig.nvim",
600+
"WhoIsSethDaniel/mason-tool-installer.nvim",
601601
opts = {
602-
ensure_installed = { "rust_analyzer" }, -- automatically install lsp
602+
ensure_installed = { "rust-analyzer" }, -- automatically install lsp
603603
},
604604
},
605605
}
@@ -701,7 +701,7 @@ return {
701701
},
702702
},
703703
{
704-
"williamboman/mason-lspconfig.nvim",
704+
"WhoIsSethDaniel/mason-tool-installer.nvim",
705705
opts = {
706706
ensure_installed = { "jdtls" },
707707
},

src/content/docs/recipes/dap.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ return {
5353

5454
### Automatically Install Debuggers
5555

56-
`mason-nvim-dap` also allows you to automatically install debuggers that you may want. This can be configured by extending the `mason-nvim-dap` plugin options:
56+
`mason-tool-installer.nvim` is the plugin AstroNvim uses to centralize Mason package management and allows you to automatically install debuggers that you may want. This can be configured by extending the `mason-tool-installer.nvim` plugin options:
5757

58-
```lua title="lua/plugins/mason-nvim-dap.lua"
58+
```lua title="lua/plugins/mason-tool-installer.lua"
5959
return {
60-
"jay-babu/mason-nvim-dap.nvim",
60+
"WhoIsSethDaniel/mason-tool-installer.nvim",
6161
opts = {
62-
ensure_installed = { "python" },
62+
ensure_installed = { "debugpy" },
6363
},
6464
}
6565
```

src/content/docs/reference/default_plugins.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ title: Default Plugins
1313
| [L3MON4D3/LuaSnip](https://github.com/L3MON4D3/LuaSnip) | Snippet Engine |
1414
| [MunifTanjim/nui.nvim](https://github.com/MunifTanjim/nui.nvim) | UI Component Library (for Neo-Tree) |
1515
| [NMAC427/guess-indent.nvim](https://github.com/NMAC427/guess-indent.nvim) | Automatic Indentation Detection |
16+
| [WhoIsSethDaniel/mason-tool-installer.nvim](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim) | Automatic Mason Installation |
1617
| [akinsho/toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim) | Terminal Management |
1718
| [brenoprata10/nvim-highlight-colors](https://github.com/brenoprata10/nvim-highlight-colors) | Highlight Color Strings |
1819
| [echasnovski/mini.bufremove](https://github.com/echasnovski/mini.bufremove) | Buffer Removal |

src/content/docs/using_the_docs.mdx

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ AstroNvim is configured nearly entirely through the configuration of Neovim plug
1010

1111
For example, a recipe or code block may look like this which describes how to automatically install the Typescript language server:
1212

13-
```lua title="lua/plugins/mason-lspconfig.lua"
13+
```lua title="lua/plugins/mason-tool-installer.lua"
1414
return {
1515
{
16-
"williamboman/mason-lspconfig.nvim",
16+
"WhoIsSethDaniel/mason-tool-installer.nvim",
1717
opts = {
18-
ensure_installed = { "tsserver" },
18+
ensure_installed = { "typescript-language-server" },
1919
},
2020
},
2121
}
@@ -26,24 +26,24 @@ This can either be fully copied and pasted into a new file in your `lua/plugins`
2626
```lua title="lua/plugins/tsserver.lua" ins={1-8}
2727
return {
2828
{
29-
"williamboman/mason-lspconfig.nvim",
29+
"WhoIsSethDaniel/mason-tool-installer.nvim",
3030
opts = {
31-
ensure_installed = { "tsserver" },
31+
ensure_installed = { "typescript-language-server" },
3232
},
3333
},
3434
}
3535
```
3636

37-
Sometimes you might want to consolidate the code as well such as if you are already automatically installing other language servers. In that case you will just want to take the code that is in the recipe and fit it into files/locations that you are already managing. For example, say you already have a `lua/plugins/mason-lspconfig.lua` file that is automatically installing the python language server:
37+
Sometimes you might want to consolidate the code as well such as if you are already automatically installing other language servers. In that case you will just want to take the code that is in the recipe and fit it into files/locations that you are already managing. For example, say you already have a `lua/plugins/mason-tool-installer.lua` file that is automatically installing the python language server:
3838

39-
```lua title="lua/plugins/mason-lspconfig.lua" ins={7}
39+
```lua title="lua/plugins/mason-tool-installer.lua" ins={7}
4040
return {
4141
{
42-
"williamboman/mason-lspconfig.nvim",
42+
"WhoIsSethDaniel/mason-tool-installer.nvim",
4343
opts = {
4444
ensure_installed = {
4545
"pyright",
46-
"tsserver",
46+
"typescript-language-server",
4747
},
4848
},
4949
},

0 commit comments

Comments
 (0)