aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/intelephense.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-06-16 14:17:07 +0200
committerJustin M. Keyes <justinkz@gmail.com>2025-06-16 14:18:24 +0200
commitfa91d1c90433aaf68c6a2774d5ffce7319effa09 (patch)
tree269972d033d7ba2df5b5effc2df99e212488c3ec /lsp/intelephense.lua
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-fa91d1c90433aaf68c6a2774d5ffce7319effa09.tar
nvim-lspconfig-fa91d1c90433aaf68c6a2774d5ffce7319effa09.tar.gz
nvim-lspconfig-fa91d1c90433aaf68c6a2774d5ffce7319effa09.tar.bz2
nvim-lspconfig-fa91d1c90433aaf68c6a2774d5ffce7319effa09.tar.lz
nvim-lspconfig-fa91d1c90433aaf68c6a2774d5ffce7319effa09.tar.xz
nvim-lspconfig-fa91d1c90433aaf68c6a2774d5ffce7319effa09.tar.zst
nvim-lspconfig-fa91d1c90433aaf68c6a2774d5ffce7319effa09.zip
fix(intelephense): workspace not found
Problem: user reports that "lsp/intelephense.lua doesn't recognize root directory despite the project contains composer.json or .git". Solution: Drop the `root_dir`, use `root_markers`. fix #3901
Diffstat (limited to 'lsp/intelephense.lua')
-rw-r--r--lsp/intelephense.lua9
1 files changed, 1 insertions, 8 deletions
diff --git a/lsp/intelephense.lua b/lsp/intelephense.lua
index b18736a9..cb40d569 100644
--- a/lsp/intelephense.lua
+++ b/lsp/intelephense.lua
@@ -28,12 +28,5 @@
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 = vim.fs.root(fname, { 'composer.json', '.git' })
-
- -- prefer cwd if root is a descendant
- on_dir(root and vim.fs.relpath(cwd, root) and cwd)
- end,
+ root_markers = { 'composer.json', '.git' },
}