diff options
Diffstat (limited to 'lua/user/lsp/mason.lua')
| -rw-r--r-- | lua/user/lsp/mason.lua | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua index af77151..1b5717d 100644 --- a/lua/user/lsp/mason.lua +++ b/lua/user/lsp/mason.lua @@ -1,4 +1,10 @@ -require("mason").setup({ +local status, mason = pcall(require, "mason") +if not status then + return +end + +-- mason +mason.setup({ ui = { icons = { package_installed = "✓", @@ -7,3 +13,31 @@ require("mason").setup({ } } }) + +-- mason-lspconfig +require("mason-lspconfig").setup { + ensure_installed = { "pylsp", "bashls", "lua_ls", "cmake" }, +} +require("mason-lspconfig").setup_handlers { + function (server_name) + require("lspconfig")[server_name].setup {} + end +} + +-- mason-null-ls +require('mason-null-ls').setup({ + automatic_setup = true, + ensure_installed = { "cpplint" } +}) +require('mason-null-ls').setup_handlers { + function(source_name, methods) + require("mason-null-ls.automatic_setup")(source_name, methods) + end, +} + +-- null_ls +local status, null_ls = pcall(require, "null-ls") +if not status then + return +end +null_ls.setup() |
