aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/elmls.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-07-03 14:45:08 -0700
committerMichael Lingelbach <m.j.lbach@gmail.com>2021-07-03 15:49:27 -0700
commitec11b85df73cce4edb2925cb7f1d0e8db3a07b1c (patch)
tree77d533dc9606ca7e9b30d1a96baebf3de325d2a8 /lua/lspconfig/elmls.lua
parent[docgen] Update CONFIG.md (diff)
downloadnvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.gz
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.bz2
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.lz
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.xz
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.tar.zst
nvim-lspconfig-ec11b85df73cce4edb2925cb7f1d0e8db3a07b1c.zip
ci: lint and format with stylua
Diffstat (limited to 'lua/lspconfig/elmls.lua')
-rw-r--r--lua/lspconfig/elmls.lua33
1 files changed, 16 insertions, 17 deletions
diff --git a/lua/lspconfig/elmls.lua b/lua/lspconfig/elmls.lua
index 9e692353..415d5eb3 100644
--- a/lua/lspconfig/elmls.lua
+++ b/lua/lspconfig/elmls.lua
@@ -1,5 +1,5 @@
-local configs = require 'lspconfig/configs'
-local util = require 'lspconfig/util'
+local configs = require "lspconfig/configs"
+local util = require "lspconfig/util"
local lsp = vim.lsp
local api = vim.api
@@ -7,29 +7,29 @@ local server_name = "elmls"
local bin_name = "elm-language-server"
local default_capabilities = lsp.protocol.make_client_capabilities()
-default_capabilities.offsetEncoding = {"utf-8", "utf-16"}
-local elm_root_pattern = util.root_pattern("elm.json")
+default_capabilities.offsetEncoding = { "utf-8", "utf-16" }
+local elm_root_pattern = util.root_pattern "elm.json"
configs[server_name] = {
default_config = {
- cmd = {bin_name};
+ cmd = { bin_name },
-- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now.
- filetypes = {"elm"};
+ filetypes = { "elm" },
root_dir = function(fname)
- local filetype = api.nvim_buf_get_option(0, 'filetype')
- if filetype == 'elm' or (filetype == 'json' and fname:match("elm%.json$")) then
+ local filetype = api.nvim_buf_get_option(0, "filetype")
+ if filetype == "elm" or (filetype == "json" and fname:match "elm%.json$") then
return elm_root_pattern(fname)
end
- end;
+ end,
init_options = {
elmPath = "elm",
elmFormatPath = "elm-format",
elmTestPath = "elm-test",
elmAnalyseTrigger = "change",
- };
- };
+ },
+ },
docs = {
- package_json = "https://raw.githubusercontent.com/elm-tooling/elm-language-client-vscode/master/package.json";
+ package_json = "https://raw.githubusercontent.com/elm-tooling/elm-language-client-vscode/master/package.json",
description = [[
https://github.com/elm-tooling/elm-language-server#installation
@@ -37,12 +37,11 @@ If you don't want to use Nvim to install it, then you can use:
```sh
npm install -g elm elm-test elm-format @elm-tooling/elm-language-server
```
-]];
+]],
default_config = {
- root_dir = [[root_pattern("elm.json")]];
- };
- };
+ root_dir = [[root_pattern("elm.json")]],
+ },
+ },
}
-- vim:et ts=2 sw=2
-