Explorar o código

add on attach to more langs

christianchiarulli %!s(int64=4) %!d(string=hai) anos
pai
achega
359c06d002
Modificáronse 4 ficheiros con 6 adicións e 1 borrados
  1. 1 0
      lua/lang/elm.lua
  2. 3 1
      lua/lang/erlang.lua
  3. 1 0
      lua/lang/euphoria3.lua
  4. 1 0
      lua/lang/sh.lua

+ 1 - 0
lua/lang/elm.lua

@@ -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",

+ 3 - 1
lua/lang/erlang.lua

@@ -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()

+ 1 - 0
lua/lang/euphoria3.lua

@@ -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
 
 

+ 1 - 0
lua/lang/sh.lua

@@ -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" },