Perfect! Now I understand the issue. Let me create a comprehensive report:
Investigation Report: Lua Workspace Configuration Issues
Root Cause Analysis
I've identified multiple configuration conflicts preventing proper Lua workspace configuration and completion:
Issue #1: Missing Lazydev Source in blink.cmp
Location: /home/jm/.config/nvim/lua/plugins/cmp.lua
Problem: The lazydev source is commented out in blink.cmp configuration (lines 50-54), which prevents lazydev from providing completions for require() statements and @module annotations.
Current Code:
providers = {
-- lazydev = {
-- name = "LazyDev",
-- enabled = true, -- Stop it from running
-- module = "blink.cmp.sources.lsp", -- Point to a module that DEFINITELY exists
-- },
Required Fix: Enable the lazydev provider with the correct module path:
providers = {
lazydev = {
name = "LazyDev",
module = "lazydev.integrations.blink",
score_offset = 100, -- prioritize lazydev completions
},
And add "lazydev" to the default sources:
sources = {
default = { "lazydev", "lsp", "path" },
per_filetype = {
lua = { "lazydev", "lsp", "path" },
},
Issue #2: Conflicting LSP Workspace Configurations
Locations:
/home/jm/.config/nvim/lsp/lua_ls.lua
/home/jm/.config/nvim/lua/config/lsp/workspace_enhancer.lua
/home/jm/.config/nvim/.luarc.jsonc
Problem: You have THREE different sources trying to configure the Lua workspace library paths:
lsp/lua_ls.lua (lines 121-126): Hardcoded library paths
workspace_enhancer.lua: Dynamic plugin path injection attempting to override lua_ls config
.luarc.jsonc (lines 37-42): Static library paths
This creates conflicts where:
- Lazydev is trying to dynamically manage workspace libraries
workspace_enhancer.lua is overriding the config (line 185: vim.lsp.config("lua_ls", ...))
- Static
.luarc.jsonc paths may not match runtime plugin locations
checkThirdParty is set to true in lua_ls.lua but "Disable" in .luarc.jsonc
Issue #3: Lazydev Integration Not Properly Configured
Location: /home/jm/.config/nvim/lua/plugins/lazydev.lua
Problem: The lazydev settings are incorrect:
settings = {
lsp = { enabled = true },
treesitter = { enabled = true },
cmp = { enabled = true }, -- This should be in 'integrations'
},
Correct Configuration:
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
integrations = {
lspconfig = true, -- Manages workspace libraries automatically
cmp = false, -- We're using blink, not nvim-cmp
},
},
Issue #4: workspace_enhancer.lua is Overriding Lazydev
Location: /home/jm/.config/nvim/lua/config/lsp/workspace_enhancer.lua
Problem: This file is calling vim.lsp.config("lua_ls", ...) (line 185), which overwrites the configuration that lazydev is trying to manage. The function apply_enhanced_config() is likely being called somewhere, conflicting with lazydev's dynamic workspace management.
Solution: Either:
- Remove the
workspace_enhancer.lua usage entirely and let lazydev manage it
- OR ensure it's not being loaded/called for the Neovim config directory
Issue #5: Commented Out on_init Logic
Location: /home/jm/.config/nvim/lsp/lua_ls.lua (lines 31-51)
Problem: Critical workspace configuration is commented out, including the logic that should configure the Lua runtime, workspace library, and Neovim-specific settings.
Recommendations
Priority 1: Enable Lazydev Properly
- Fix the blink.cmp configuration to include the lazydev source
- Correct the lazydev plugin configuration (integrations, not settings)
- Remove or disable
workspace_enhancer.lua for your Neovim config
Priority 2: Consolidate Workspace Configuration
- Let lazydev handle dynamic library management
- Keep
.luarc.jsonc minimal (only for editor hints)
- Remove conflicting static library paths from
lua_ls.lua
Priority 3: Verify No LSP Conflicts
Check that no other LSPs are interfering by running:
:lua vim.print(vim.lsp.get_clients())
Would you like me to create a patch to fix these issues?