diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/mason-lspconfig/lspconfig_hook.lua | 29 | ||||
| -rw-r--r-- | lua/mason-lspconfig/settings.lua | 11 |
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, |
