Closed SingularisArt closed 2 years ago
You aren't using mason-tool-installer
anywhere. Was this bug report intended for this repo?
If I assume this was intended for this repo there are a number of problems:
mason-tool-installer
mason-lspconfig
's ensure_installed -- which will only install LSP servers (and will skip over non-LSP servers in your list)mason
name for each server. e.g. lspconfig name: sumneko_lua
, mason
name: lua-language-server
.For the second point above you can use ensure_installed with mason-lspconfig* if you want, but it's better (at least IMO) to just use
mason-tool-installer` to install everything (see below).
So, let's say you want to use mason-tool-installer
you would change some of your config to:
[...]
require'mason-lspconfig'.setup()
require'mason-tool-installer'.setup({
ensure_installed = {
"lua-language-server",
"vim-language-server",
"texlab",
"python-lsp-server",
"bash-language-server",
"clangd",
"cmake",
"html",
"emmet-ls",
"css-lsp",
"tailwindcss-language-server",
"json-lsp",
"rust-analyzer",
"solang",
"solidity",
"marksman",
"golangci-lint-langserver",
"typescript-language-server",
"jdtls",
"yam-language-server",
"black",
"clang_format",
"latexindent",
"prettier",
"rustfmt",
"sql_formatter",
"standardrb",
"stylua",
"google_java_format",
"shellharden",
"flake8",
"cppcheck",
"write_good",
}
})
[...]
I likely missed a few language servers that have different names. There is a mapping here: https://github.com/williamboman/mason-lspconfig.nvim/blob/main/doc/server-mapping.md that will show the mapping from lspconfig to mason names.
Thank you. I had mason-tool-installer installed, but I configured mason-lsp-config instead. LOL. Anyway, thanks for the solution!
@SingularisArt, as stated by WhoIsSethDaniel mason-tool-installer
works well, If you are looking for an elegant solution, you can check out this example>
Full config here: rohit-kumar-j/nvim
It provides full control of lsp, formatting, linting, and dap with mason and others fully from within the main init.lua file. Works out of the box with lazy.nvim
and keybindings in Which-key
.
Currently I am actively maintaining it
Here's my minimal
init.lua
:My minimal
plugins.lua
My minimal
lsp.lua
:But mason installs only the servers, not the linters and formatters. I even tried this with the dap servers, but it doesn't work either. Am I missing something, or is this a bug in the plugin because I've got no idea?