aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2025-04-21 19:28:33 +0200
committerWilliam Boman <william@redwill.se>2025-04-21 19:28:33 +0200
commit5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9 (patch)
tree4ac215a1b5d3eb6a2cb2a61ea46a81ea9d581da1 /lua
parentv2.0.0-rc.1 (diff)
downloadmason-lspconfig-5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9.tar
mason-lspconfig-5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9.tar.gz
mason-lspconfig-5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9.tar.bz2
mason-lspconfig-5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9.tar.lz
mason-lspconfig-5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9.tar.xz
mason-lspconfig-5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9.tar.zst
mason-lspconfig-5c142464ea29ceca3b4d77d2c80b9e8e3fca02d9.zip
refactor!: remove `automatic_installation` setting
This is removed because of the transition towards `vim.lsp.config`-style configurations.
Diffstat (limited to 'lua')
-rw-r--r--lua/mason-lspconfig/lspconfig_hook.lua29
-rw-r--r--lua/mason-lspconfig/settings.lua11
2 files changed, 0 insertions, 40 deletions
diff --git a/lua/mason-lspconfig/lspconfig_hook.lua b/lua/mason-lspconfig/lspconfig_hook.lua
index cc7606f..04010f1 100644
--- a/lua/mason-lspconfig/lspconfig_hook.lua
+++ b/lua/mason-lspconfig/lspconfig_hook.lua
@@ -5,22 +5,6 @@ local platform = require "mason-core.platform"
local memoized_set = _.memoize(_.set_of)
----@param server_name string
-local function should_auto_install(server_name)
- if platform.is_headless then
- return false
- end
- local settings = require "mason-lspconfig.settings"
-
- if settings.current.automatic_installation == true then
- return true
- end
- if type(settings.current.automatic_installation) == "table" then
- return not memoized_set(settings.current.automatic_installation.exclude)[server_name]
- end
- return false
-end
-
---@param lspconfig_server_name string
local function resolve_server_config_factory(lspconfig_server_name)
local Optional = require "mason-core.optional"
@@ -84,19 +68,6 @@ return function()
log.error("Failed to expand cmd path", config.name, config.cmd)
end
end
- elseif should_auto_install(config.name) then
- local ok, pkg = pcall(registry.get_package, pkg_name)
- if ok then
- require("mason-lspconfig.install").install(pkg):once(
- "closed",
- vim.schedule_wrap(function()
- if pkg:is_installed() then
- -- reload config
- require("lspconfig")[config.name].setup(config)
- end
- end)
- )
- end
end
end)
end
diff --git a/lua/mason-lspconfig/settings.lua b/lua/mason-lspconfig/settings.lua
index f808a25..e852a3d 100644
--- a/lua/mason-lspconfig/settings.lua
+++ b/lua/mason-lspconfig/settings.lua
@@ -3,20 +3,9 @@ local M = {}
---@class MasonLspconfigSettings
local DEFAULT_SETTINGS = {
-- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer@nightly", "lua_ls" }
- -- This setting has no relation with the `automatic_installation` setting.
---@type string[]
ensure_installed = {},
- -- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
- -- This setting has no relation with the `ensure_installed` setting.
- -- Can either be:
- -- - false: Servers are not automatically installed.
- -- - true: All servers set up via lspconfig are automatically installed.
- -- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed.
- -- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
- ---@type boolean
- automatic_installation = false,
-
-- See `:h mason-lspconfig.setup_handlers()`
---@type table<string, fun(server_name: string)>?
handlers = nil,