add on attach to more langs

This commit is contained in:
christianchiarulli 2021-07-15 13:49:15 -04:00
parent 776c3ca935
commit 359c06d002
4 changed files with 6 additions and 1 deletions

View file

@ -21,6 +21,7 @@ M.lsp = function()
require("lspconfig").elmls.setup { require("lspconfig").elmls.setup {
cmd = { DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server" }, cmd = { DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server" },
on_attach = require("lsp").common_on_attach,
init_options = { init_options = {
elmAnalyseTrigger = "change", elmAnalyseTrigger = "change",
elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format", elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format",

View file

@ -19,7 +19,9 @@ M.lsp = function()
return return
end end
require("lspconfig").erlangls.setup {} require("lspconfig").erlangls.setup {
on_attach = require("lsp").common_on_attach,
}
end end
M.dap = function() M.dap = function()

View file

@ -23,6 +23,7 @@ M.lsp = function()
-- TODO: Remove this at some point -- TODO: Remove this at some point
require("lspconfig").elixirls.setup { require("lspconfig").elixirls.setup {
cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh" }, cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh" },
on_attach = require("lsp").common_on_attach,
} }
end end

View file

@ -55,6 +55,7 @@ M.lint = function()
require("lspconfig").efm.setup { require("lspconfig").efm.setup {
-- init_options = {initializationOptions}, -- init_options = {initializationOptions},
cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" },
on_attach = require("lsp").common_on_attach,
init_options = { documentFormatting = true, codeAction = false }, init_options = { documentFormatting = true, codeAction = false },
root_dir = require("lspconfig").util.root_pattern ".git/", root_dir = require("lspconfig").util.root_pattern ".git/",
filetypes = { "sh" }, filetypes = { "sh" },