aboutsummaryrefslogtreecommitdiffstats
path: root/lsp
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-04-23 14:58:31 +0200
committerJustin M. Keyes <justinkz@gmail.com>2025-04-23 15:08:14 +0200
commit79c12bc6e789dc3774a55289cc8fdedbd3b8ca38 (patch)
tree665054da7a577eaa53f155997e8cd84b7366de71 /lsp
parentrefactor: deprecate util functions (diff)
downloadnvim-lspconfig-79c12bc6e789dc3774a55289cc8fdedbd3b8ca38.tar
nvim-lspconfig-79c12bc6e789dc3774a55289cc8fdedbd3b8ca38.tar.gz
nvim-lspconfig-79c12bc6e789dc3774a55289cc8fdedbd3b8ca38.tar.bz2
nvim-lspconfig-79c12bc6e789dc3774a55289cc8fdedbd3b8ca38.tar.lz
nvim-lspconfig-79c12bc6e789dc3774a55289cc8fdedbd3b8ca38.tar.xz
nvim-lspconfig-79c12bc6e789dc3774a55289cc8fdedbd3b8ca38.tar.zst
nvim-lspconfig-79c12bc6e789dc3774a55289cc8fdedbd3b8ca38.zip
refactor: deprecate util.path.search_ancestors()
Diffstat (limited to 'lsp')
-rw-r--r--lsp/fennel_ls.lua4
-rw-r--r--lsp/foam_ls.lua4
-rw-r--r--lsp/vala_ls.lua4
3 files changed, 3 insertions, 9 deletions
diff --git a/lsp/fennel_ls.lua b/lsp/fennel_ls.lua
index bbcb0a99..4023e021 100644
--- a/lsp/fennel_ls.lua
+++ b/lsp/fennel_ls.lua
@@ -7,8 +7,6 @@
--- fennel-ls is configured using the closest file to your working directory named `flsproject.fnl`.
--- All fennel-ls configuration options [can be found here](https://git.sr.ht/~xerool/fennel-ls/tree/HEAD/docs/manual.md#configuration).
-local util = require 'lspconfig.util'
-
return {
cmd = { 'fennel-ls' },
filetypes = { 'fennel' },
@@ -18,7 +16,7 @@ return {
local fnlpath = vim.fs.joinpath(path, 'flsproject.fnl')
return (vim.uv.fs_stat(fnlpath) or {}).type == 'file'
end
- on_dir(util.search_ancestors(fname, has_fls_project_cfg) or vim.fs.root(0, '.git'))
+ on_dir(vim.iter(vim.fs.parents(fname)):find(has_fls_project_cfg) or vim.fs.root(0, '.git'))
end,
settings = {},
capabilities = {
diff --git a/lsp/foam_ls.lua b/lsp/foam_ls.lua
index c7a47f3c..bbc9d728 100644
--- a/lsp/foam_ls.lua
+++ b/lsp/foam_ls.lua
@@ -7,14 +7,12 @@
--- npm install -g foam-language-server
--- ```
-local util = require 'lspconfig.util'
-
return {
cmd = { 'foam-ls', '--stdio' },
filetypes = { 'foam', 'OpenFOAM' },
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
- on_dir(util.search_ancestors(fname, function(path)
+ on_dir(vim.iter(vim.fs.parents(fname)):find(function(path)
if vim.uv.fs_stat(path .. '/system/controlDict') then
return path
end
diff --git a/lsp/vala_ls.lua b/lsp/vala_ls.lua
index 3faff1d8..a2d9059f 100644
--- a/lsp/vala_ls.lua
+++ b/lsp/vala_ls.lua
@@ -2,8 +2,6 @@
---
--- https://github.com/Prince781/vala-language-server
-local util = require 'lspconfig.util'
-
local meson_matcher = function(path)
local pattern = 'meson.build'
local f = vim.fn.glob(table.concat({ path, pattern }, '/'))
@@ -30,7 +28,7 @@ return {
filetypes = { 'vala', 'genie' },
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
- local root = util.search_ancestors(fname, meson_matcher)
+ local root = vim.iter(vim.fs.parents(fname)):find(meson_matcher)
on_dir(root or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]))
end,
}