aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/phpactor.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-06-16 14:08:59 +0200
committerJustin M. Keyes <justinkz@gmail.com>2025-06-16 14:10:25 +0200
commitf0b1623d629a3bfa1933495824fcdf09bec3afe4 (patch)
tree0bd17d69ec4b2217a046471c989eba12b230f48f /lsp/phpactor.lua
parentfix!: drop support for multiple args in :LspStop/:LspRestart #3896 (diff)
downloadnvim-lspconfig-f0b1623d629a3bfa1933495824fcdf09bec3afe4.tar
nvim-lspconfig-f0b1623d629a3bfa1933495824fcdf09bec3afe4.tar.gz
nvim-lspconfig-f0b1623d629a3bfa1933495824fcdf09bec3afe4.tar.bz2
nvim-lspconfig-f0b1623d629a3bfa1933495824fcdf09bec3afe4.tar.lz
nvim-lspconfig-f0b1623d629a3bfa1933495824fcdf09bec3afe4.tar.xz
nvim-lspconfig-f0b1623d629a3bfa1933495824fcdf09bec3afe4.tar.zst
nvim-lspconfig-f0b1623d629a3bfa1933495824fcdf09bec3afe4.zip
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
Diffstat (limited to 'lsp/phpactor.lua')
-rw-r--r--lsp/phpactor.lua10
1 files changed, 2 insertions, 8 deletions
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,
}