From 2638104bae3b204e3915a2aa280a16844e9f734d Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 6 Dec 2025 23:42:44 +0000 Subject: [PATCH] lspconfig root detection not fixed, workaround noted --- MIGRATION_PLAN.md | 2 ++ lua/plugins/lsp.lua | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/MIGRATION_PLAN.md b/MIGRATION_PLAN.md index fc3859b..dc3ca6f 100644 --- a/MIGRATION_PLAN.md +++ b/MIGRATION_PLAN.md @@ -80,6 +80,7 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date. - [x] Add `nvim-lspconfig` with minimal defaults (no over-configuration) - [x] Add minimal LSP on-attach keymaps (gd, gr, K, gD, gI) - [x] Add global LSP keymaps with fallback in `lua/keymaps.lua` + - [x] InteIephense root guard: enforce root_dir priority (`.neoconf.json`, `composer.json`, `.nvimroot`, `.git`) and set `single_file_support=false` ## Phase 3.6 — LSP server management (Mason) - [x] Confirm scope and priorities for this subphase @@ -206,3 +207,4 @@ Known Issues / Follow-ups: - Install lua-language-server via system package manager compatible with your distro. - Provide the required `libbfd` or adjust symlink to match expected soname. - Skip lua_ls for now; neoconf validation can be done with other servers (e.g., jsonls) and PHP (intelephense). +- LSP root detection: In some cases, the parent repository is picked as the root (e.g., when a workspace lives inside another repo). Workaround: create an empty `.git` directory (or a marker like `.nvimroot`) in the intended workspace root to pin the project root for LSPs. diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 726fe41..e322999 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -49,6 +49,17 @@ return { setup("jsonls") setup("bashls") setup("marksman") - setup("intelephense") + -- TODO(r): Root detection can pick a parent repo in nested setups. + -- Workaround noted in MIGRATION_PLAN.md: create an empty `.git` (or `.nvimroot`) + -- in the intended workspace root to pin LSP root until we refine root_dir further. + setup("intelephense", { + single_file_support = false, + root_dir = util.root_pattern( + ".neoconf.json", + "composer.json", + ".nvimroot", + ".git" + ), + }) end, }