aboutsummaryrefslogtreecommitdiffstats
path: root/lua/pi/lsp/mason.lua
blob: 6c959a6ad53a459795cd7659bea40964b20e2358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local mason_lspconfig = require "mason-lspconfig"
local servers = require "pi.lsp.servers"

-- Note: This file is deprecated in favor of native LSP configuration
-- Keeping for reference/compatibility

local mason_servers = {}

-- Since we're using native LSP, we'll check for executables differently
local server_commands = {
  lua_ls = "lua-language-server",
  gopls = "gopls",
  ts_ls = "typescript-language-server",
  -- Add other servers as needed
}

for server, _ in pairs(servers) do
  local cmd = server_commands[server] or server
  if vim.fn.executable(cmd) == 0 then
    table.insert(mason_servers, server)
  end
end

mason_lspconfig.setup {
  -- ensure_installed = mason_servers,
}

-- filter the list for the ones not globally installed
-- require("mason-tool-installer").setup {
--   ensure_installed = vim.tbl_filter(function (tool)
--     return vim.fn.executable(tool) == 0
--   end, require "pi.lsp.tools"),
-- }