From f0b1623d629a3bfa1933495824fcdf09bec3afe4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 16 Jun 2025 14:08:59 +0200 Subject: fix(phpactor): phpactor crashes on non-root paths Problem: phpactor crashes on non-root paths. Solution: Require a workspace, and drop the `root_dir` approach. fix #3888 --- lsp/phpactor.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lsp/phpactor.lua') diff --git a/lsp/phpactor.lua b/lsp/phpactor.lua index 9b7d3d82..41f6921d 100644 --- a/lsp/phpactor.lua +++ b/lsp/phpactor.lua @@ -7,12 +7,6 @@ return { cmd = { 'phpactor', 'language-server' }, 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 = vim.fs.root(fname, { 'composer.json', '.git', '.phpactor.json', '.phpactor.yml' }) - - -- prefer cwd if root is a descendant - on_dir(root and vim.fs.relpath(cwd, root) and cwd) - end, + root_markers = { 'composer.json', '.git', '.phpactor.json', '.phpactor.yml' }, + workspace_required = true, } -- cgit v1.2.3-70-g09d2