diff options
author | ichigo-gyuunyuu <[email protected]> | 2021-07-21 01:03:15 +0530 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-21 00:03:15 +0430 |
commit | 0064b446a02be13dba0f16f084e073b347716710 (patch) | |
tree | 203f9907132b86c37733096bd139cf224b4dd1ad /lua/lang/elm.lua | |
parent | 9e640fa4d99beeec97292a00a51b335960aa2b0f (diff) |
[Feature] Allow for custom path to a language server binary (#1043)
Diffstat (limited to 'lua/lang/elm.lua')
-rw-r--r-- | lua/lang/elm.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lua/lang/elm.lua b/lua/lang/elm.lua index 54526e0c..8fc8cebb 100644 --- a/lua/lang/elm.lua +++ b/lua/lang/elm.lua @@ -1,7 +1,16 @@ local M = {} M.config = function() - O.lang.elm = {} + local elm_bin = DATA_PATH .. "/lspinstall/elm/node_modules/.bin" + + O.lang.elm = { + lsp = { + path = elm_bin .. "/elm-language-server", + format = elm_bin .. "/elm-format", + root = elm_bin, + test = elm_bin .. "/elm-test", + }, + } end M.format = function() @@ -20,13 +29,13 @@ M.lsp = function() end require("lspconfig").elmls.setup { - cmd = { DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server" }, + cmd = { O.lang.elm.lsp.path }, on_attach = require("lsp").common_on_attach, init_options = { elmAnalyseTrigger = "change", - elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format", - elmPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm", - elmTestPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-test", + elmFormatPath = O.lang.elm.lsp.format, + elmPath = O.lang.elm.lsp.root, + elmTestPath = O.lang.elm.lsp.test, }, } end |