From a23e15d9da72ce50a092ad369417933437adb31d Mon Sep 17 00:00:00 2001 From: naps62 Date: Mon, 17 Aug 2026 13:00:35 +0000 Subject: [PATCH] fix(lsp): stop dropping LSP plugins on a cold clone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file required configs.lspconfig at spec-import time, which pulls in nvchad.configs.lspconfig. On a fresh clone NvChad is not installed yet, so the import threw and lazy skipped every spec below it — rustaceanvim, typescript-tools, actions-preview, nui and lsp-endhints were all missing until the second launch. Verified against a wiped profile. Co-Authored-By: Claude Opus 5 --- lua/plugins/lsp.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 30f8606..e1fd2c9 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,12 +1,11 @@ -local configs = require "configs.lspconfig" - -vim.g.rustaceanvim = configs.rustacean - +-- configs.lspconfig pulls in nvchad.configs.lspconfig, which does not exist until +-- NvChad is installed. Requiring it at spec-import time makes this whole file fail +-- on a cold clone, silently dropping every LSP plugin below from the first launch. return { { "neovim/nvim-lspconfig", config = function() - configs.defaults() + require("configs.lspconfig").defaults() end, }, @@ -14,6 +13,9 @@ return { "mrcjkb/rustaceanvim", version = "^6", lazy = false, + init = function() + vim.g.rustaceanvim = require("configs.lspconfig").rustacean + end, }, { @@ -21,7 +23,7 @@ return { ft = { "typescript", "typescriptreact" }, dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, config = function() - require("typescript-tools").setup(configs.typescript) + require("typescript-tools").setup(require("configs.lspconfig").typescript) end, },