From 2a6517453feb6f00e3d64bcb4fde61934897f4bd Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 4 May 2025 14:11:18 -0700 Subject: 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()`.. --- lsp/intelephense.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lsp/intelephense.lua') diff --git a/lsp/intelephense.lua b/lsp/intelephense.lua index bf03985d..b18736a9 100644 --- a/lsp/intelephense.lua +++ b/lsp/intelephense.lua @@ -25,17 +25,15 @@ --- } --- ``` -local util = require 'lspconfig.util' - return { cmd = { 'intelephense', '--stdio' }, filetypes = { 'php' }, root_dir = function(bufnr, on_dir) local fname = vim.api.nvim_buf_get_name(bufnr) local cwd = assert(vim.uv.cwd()) - local root = util.root_pattern('composer.json', '.git')(fname) + local root = vim.fs.root(fname, { 'composer.json', '.git' }) -- prefer cwd if root is a descendant - on_dir(vim.fs.relpath(cwd, root) and cwd or root) + on_dir(root and vim.fs.relpath(cwd, root) and cwd) end, } -- cgit v1.2.3-70-g09d2