diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-05-04 14:11:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-04 14:11:18 -0700 |
| commit | 2a6517453feb6f00e3d64bcb4fde61934897f4bd (patch) | |
| tree | dc681744b655f6eb40478ef6d7ae5495686f2b71 /lsp/elmls.lua | |
| parent | feat: support :LspStart/LspRestart in Nvim 0.11.2+ #3734 (diff) | |
| download | nvim-lspconfig-2a6517453feb6f00e3d64bcb4fde61934897f4bd.tar nvim-lspconfig-2a6517453feb6f00e3d64bcb4fde61934897f4bd.tar.gz nvim-lspconfig-2a6517453feb6f00e3d64bcb4fde61934897f4bd.tar.bz2 nvim-lspconfig-2a6517453feb6f00e3d64bcb4fde61934897f4bd.tar.lz nvim-lspconfig-2a6517453feb6f00e3d64bcb4fde61934897f4bd.tar.xz nvim-lspconfig-2a6517453feb6f00e3d64bcb4fde61934897f4bd.tar.zst nvim-lspconfig-2a6517453feb6f00e3d64bcb4fde61934897f4bd.zip | |
fix(configs): eliminate some usages of root_pattern #3820
Problem:
`root_pattern` is not necessary for non-glob patterns.
Solution:
Replace non-glob cases with `vim.fs.root()`..
Diffstat (limited to 'lsp/elmls.lua')
| -rw-r--r-- | lsp/elmls.lua | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lsp/elmls.lua b/lsp/elmls.lua index bee05b89..a7f27789 100644 --- a/lsp/elmls.lua +++ b/lsp/elmls.lua @@ -7,11 +7,8 @@ --- npm install -g elm elm-test elm-format @elm-tooling/elm-language-server --- ``` -local util = require 'lspconfig.util' local api = vim.api -local elm_root_pattern = util.root_pattern 'elm.json' - return { cmd = { 'elm-language-server' }, -- 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. @@ -20,7 +17,7 @@ return { local fname = api.nvim_buf_get_name(bufnr) local filetype = api.nvim_buf_get_option(0, 'filetype') if filetype == 'elm' or (filetype == 'json' and fname:match 'elm%.json$') then - on_dir(elm_root_pattern(fname)) + on_dir(vim.fs.root(fname, 'elm.json')) return end on_dir(nil) |
