lspconfig root detection not fixed, workaround noted

This commit is contained in:
Ray Elliott 2025-12-06 23:42:44 +00:00
parent 319c66bc0a
commit 2638104bae
2 changed files with 14 additions and 1 deletions

View File

@ -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.

View File

@ -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,
}