2024-04-03 18:24:08 +08:00
|
|
|
return {
|
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
|
|
|
opts = {
|
2024-04-08 14:55:58 +08:00
|
|
|
ensure_installed = {
|
|
|
|
"svelte",
|
|
|
|
},
|
2024-05-03 22:22:52 +08:00
|
|
|
servers = {
|
|
|
|
eslint = {
|
|
|
|
settings = {
|
|
|
|
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
|
|
|
|
workingDirectories = { mode = "location" },
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
2024-04-08 14:55:58 +08:00
|
|
|
setup = {
|
|
|
|
eslint = function()
|
|
|
|
require("lazyvim.util").lsp.on_attach(function(client)
|
|
|
|
if client.name == "eslint" then
|
|
|
|
client.server_capabilities.documentFormattingProvider = true
|
|
|
|
elseif client.name == "tsserver" then
|
|
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
end,
|
|
|
|
},
|
2024-04-03 18:24:08 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|