Skip to content

Commit

Permalink
✨ (lsp.lua) Add vimls and moonbit-lsp to autostart servers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Comamoca committed Oct 9, 2024
1 parent 7c993d0 commit f610474
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions config/nvim/lua/configs/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ local lspconfig = require("lspconfig")

local util = lspconfig.util

server_config.moonbit = require "configs/moonbit_lsp"
-- server_config.moonbit = require "configs/moonbit_lsp"
server_config.moonbit = require("moonbit_lsp")

lspconfig.moonbit.setup({})
lspconfig.metals.setup({})
Expand Down Expand Up @@ -40,17 +41,19 @@ local servers = {
"ruby_lsp",
"gopls",
"denols",
"moonbit"
"moonbit",
"vimls"
}

-- Auto start language servers.
for _, name in ipairs(servers) do
-- for _, name in ipairs(lspconfig.util.available_servers()) do
if name == "denols" or name == "tsserver" then
local is_node_dir = function()
return lspconfig.util.root_pattern("package.json")(vim.fn.getcwd() ~= nil)
return lspconfig.util.root_pattern("package.json")(vim.fn.getcwd())
end


-- ts_ls
local ts_opts = {}
ts_opts.on_attach = function(client)
Expand All @@ -71,14 +74,15 @@ for _, name in ipairs(servers) do
elseif name == "tailwindcss" then
lspconfig.tailwindcss.setup({})
-- lspconfig[name].setup({})
elseif name == "efm" then
lspconfig.tailwindcss.setup({
init_options = {
rootMarkers = {
".git/",
},
},
})
else
lspconfig[name].setup({})
end
end

Expand Down

0 comments on commit f610474

Please sign in to comment.