···11-local lspconfig = vim.lsp.config
11+local servers = { "nil_ls", "rust_analyzer", "gleam", "lua_ls", "zls", "taplo", "tailwindcss", "cssls" }
2233+for _, server in ipairs(servers) do
44+ local config = vim.lsp.config[server]
3544-local servers = { "nil_ls", "rust_analyzer", "gleam", "lua_ls", "zls", "taplo", "tailwindcss", "cssls" }
66+ -- It failed to load w my careful approach so here we go just enabling all of em like yeet
77+ vim.lsp.enable(server)
5866-for _, server in ipairs(servers) do
77- local config = lspconfig[server]
88-99- if config and config.default_config then
1010- local cmd = config.default_config.cmd
1111- if cmd and cmd[1] and vim.fn.executable(cmd[1]) == 1 then
1212- vim.lsp.enable(server)
1313-1414- end
1515- end
99+ if config and config.default_config then
1010+ local cmd = config.default_config.cmd
1111+ if cmd and cmd[1] and vim.fn.executable(cmd[1]) == 1 then
1212+ vim.lsp.config(server, {
1313+ root_dir = vim.fs.root(0, { ".git", "Cargo.toml", "package.json", "flake.nix" }) or vim.fn.getcwd(),
1414+ })
1515+ vim.lsp.enable(server)
1616+ end
1717+ end
1618end
17191818-vim.api.nvim_create_autocmd('LspAttach', {
1919- callback = function(args)
2020- local client = vim.lsp.get_client_by_id(args.data.client_id)
2121- if client and client.supports_method('textDocument/completion') then
2222- vim.lsp.completion.enable(true, client.id, args.buf)
2323- end
2424- end,
2525-})2020+vim.api.nvim_create_autocmd("LspAttach", {
2121+ callback = function(args)
2222+ local client = vim.lsp.get_client_by_id(args.data.client_id)
2323+ if
2424+ client
2525+ -- and client.supports_method("textDocument/completion")
2626+ then
2727+ vim.lsp.completion.enable(true, client.id, args.buf)
2828+ end
2929+ end,
3030+})