chore: do not use pinned elixir-ls versions

There is no need to pin `elixir-ls` version for older versions of
elixir.
This commit is contained in:
2025-07-15 20:15:02 -03:00
parent fdbf1bb131
commit a4ee703b77
4 changed files with 8 additions and 71 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/init.lua b/init.lua
index b98ffc6..f2d0ea5 100644
index b98ffc6..d9e223a 100644
--- a/init.lua
+++ b/init.lua
@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
@@ -137,7 +137,7 @@ index b98ffc6..f2d0ea5 100644
}
-- Ensure the servers and tools above are installed
@@ -719,20 +782,50 @@ require('lazy').setup({
@@ -719,20 +782,36 @@ require('lazy').setup({
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
@@ -158,21 +158,7 @@ index b98ffc6..f2d0ea5 100644
+ local extend_server_config = function (server_name)
+ local config = {}
+
+ if server_name == 'elixirls' then
+ -- overwrite elixirls for older versions of elixir
+ -- * elixir 1.11 use version 0.12.0
+ -- * elixir 1.12 use verions 0.14.6
+ local version = vim.fn.system('mise current elixir') or ''
+ local elixir_servers = {
+ { version = '^1.11', path = '/elixir-ls/release/v0.12.0/language_server.sh' },
+ { version = '^1.12', path = '/elixir-ls/release/v0.14.6/language_server.sh' },
+ }
+ for _, ex_server in ipairs(elixir_servers) do
+ if string.match(version, ex_server.version) == nil then goto continue end
+ config = { cmd = { vim.fn.expand('$LOCAL_SRC_HOME') .. ex_server.path } }
+ ::continue::
+ end
+ elseif server_name == 'pyright' then
+ if server_name == 'pyright' then
+ -- overwrite python path for pyright according to the virtualenv manager, be it poetry or system.
+ local python_paths = {
+ { name = 'system', cmd = { 'which', 'python' }},
@@ -202,7 +188,7 @@ index b98ffc6..f2d0ea5 100644
end,
},
@@ -809,6 +902,9 @@ require('lazy').setup({
@@ -809,6 +888,9 @@ require('lazy').setup({
opts = {},
},
'folke/lazydev.nvim',
@@ -212,7 +198,7 @@ index b98ffc6..f2d0ea5 100644
},
--- @module 'blink.cmp'
--- @type blink.cmp.Config
@@ -854,9 +950,19 @@ require('lazy').setup({
@@ -854,9 +936,19 @@ require('lazy').setup({
},
sources = {
@@ -233,7 +219,7 @@ index b98ffc6..f2d0ea5 100644
},
},
@@ -882,19 +988,39 @@ require('lazy').setup({
@@ -882,19 +974,39 @@ require('lazy').setup({
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
@@ -279,7 +265,7 @@ index b98ffc6..f2d0ea5 100644
end,
},
@@ -944,7 +1070,39 @@ require('lazy').setup({
@@ -944,7 +1056,39 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
@@ -320,7 +306,7 @@ index b98ffc6..f2d0ea5 100644
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
@@ -974,17 +1132,17 @@ require('lazy').setup({
@@ -974,17 +1118,17 @@ require('lazy').setup({
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug',