@@ -57,7 +57,8 @@ settings["disabled_plugins"] = {}
5757-- These settings will override the defaults during initialization.
5858-- Parameters will auto-complete as you type.
5959-- Example: { sky = "#04A5E5" }
60- --- @type palette[]
60+ --- @type palette
61+ --- @diagnostic disable-next-line : missing-fields
6162settings [" palette_overwrite" ] = {}
6263
6364-- Set the colorscheme here.
@@ -84,23 +85,19 @@ settings["external_browser"] = "chrome-cli open"
8485--- @type boolean
8586settings [" lsp_inlayhints" ] = false
8687
87- -- LSPs installed outside Mason (e.g. via system package manager).
88- -- These will be configured but not installed by Mason.
89- -- Key: lspconfig server name, Value: executable name to check availability.
90- --- @type table<string , string>
91- settings [" external_lsp_deps" ] = {
92- nixd = " nixd" ,
93- nil_ls = " nil" ,
94- shuck = " shuck" , -- shell linter/formatter/LSP (Rust); installed via mise, not Mason
95- -- dartls = "dart",
96- }
97-
98- -- LSPs to install during bootstrap.
88+ -- Language servers to enable, resolved discovery-first at runtime: binary on $PATH is
89+ -- used as-is; else Mason installs it when it ships a package; else an aggregated warning
90+ -- asks you to provision it. Names whose filetypes lspconfig knows resolve on that
91+ -- filetype's FIRST buffer (a late sweep classifies the rest once per session); names
92+ -- with user overrides, repo modules that override filetypes, or no filetype data
93+ -- resolve on the first file open. See `modules.utils.tools` and
94+ -- `completion/mason-lspconfig.lua`.
9995-- Full list: https://github.com/neovim/nvim-lspconfig/tree/master/lsp
10096--- @type string[]
10197settings [" lsp_deps" ] = {
10298 " bashls" ,
10399 " clangd" ,
100+ -- "dartls", -- Dart LSP (ships with the Dart SDK)
104101 " dockerls" ,
105102 " gh_actions_ls" ,
106103 -- "gitlab_ci_ls",
@@ -111,7 +108,10 @@ settings["lsp_deps"] = {
111108 " lua_ls" ,
112109 " marksman" ,
113110 " neocmake" ,
111+ " nil_ls" , -- Nix LSP; the Nix-provisioned $PATH binary is preferred
112+ " nixd" , -- Nix LSP (Rust); provisioned from Nix ($PATH)
114113 " ruff" ,
114+ " shuck" , -- shell linter/formatter/LSP (Rust); installed via mise by choice ($PATH wins)
115115 " systemd_lsp" ,
116116 " terraformls" ,
117117 " tflint" ,
@@ -120,39 +120,56 @@ settings["lsp_deps"] = {
120120 " zuban" ,
121121}
122122
123- -- Formatters to install during bootstrap (Mason package names).
124- -- These are managed by Mason and used by conform.nvim .
123+ -- Formatters to resolve when conform.nvim lazy-loads (first BufWritePre /
124+ -- :Format). conform formatter names, resolved discovery-first like lsp_deps .
125125--- @type string[]
126126settings [" formatter_deps" ] = {
127127 " beautysh" ,
128128 " clang-format" ,
129- " cmakelang " ,
129+ " cmake_format " ,
130130 " fixjson" ,
131131 " gofumpt" ,
132132 " goimports" ,
133133 " mdsf" ,
134+ " nixfmt" , -- Nix formatter; prefer the $PATH binary (Nix)
134135 " prettier" ,
135136 " superhtml" ,
136137 " shellharden" ,
138+ " statix" , -- Nix linter, its `fix` mode doubles as a conform formatter; from Nix ($PATH)
137139 " stylua" ,
138140}
139141
140- -- Linters to install during bootstrap (Mason package names).
141- -- These are managed by Mason and used by nvim-lint.
142+ -- Linters to resolve discovery-first (nvim-lint linter names). A name mapped
143+ -- to a filetype resolves on that filetype's FIRST matching event after
144+ -- nvim-lint lazy-loads (the resolve-only FileType autocmd or a lint event) —
145+ -- nothing is installed or warned about before such a buffer opens; unmapped
146+ -- names (typos, manual-only linters) get an immediate deferred pass instead.
142147--- @type string[]
143148settings [" linter_deps" ] = {
144149 " actionlint" ,
150+ " deadnix" , -- Nix dead-code linter; prefer the $PATH binary (Nix)
145151 " hadolint" ,
146152 " markdownlint-cli2" ,
147153 " oxlint" ,
148154 -- "rumdl", -- markdownlint Rust rewrite; waiting for rule coverage to mature
149- " golangci-lint " ,
155+ " golangcilint " ,
150156 " selene" ,
151157 " shellcheck" ,
158+ " shuck" , -- shell linter for yaml.github `run:` blocks; installed via mise by choice
159+ " statix" , -- Nix linter; prefer the $PATH binary (Nix)
152160 " systemdlint" ,
161+ " zsh" , -- `zsh -n` syntax check via the system shell itself
153162}
154163
155- -- Debug Adapter Protocol (DAP) clients to install and configure during bootstrap.
164+ -- Deadline (ms) for background Mason work before the aggregated missing-tool warning
165+ -- flushes anyway. Gates each tracked install (its own window) AND the registry refresh
166+ -- wait; late completions still recover. Missing or non-positive values fall back to
167+ -- the resolver's DEFAULT_TOOL_INSTALL_TIMEOUT_MS in `modules/utils/tools.lua`.
168+ --- @type number
169+ settings [" tool_install_timeout" ] = 300000
170+
171+ -- DAP adapters to enable (mason-nvim-dap adapter names), resolved
172+ -- discovery-first when nvim-dap lazy-loads (first :Dap* command or debug keymap).
156173-- Supported DAPs: https://github.com/jay-babu/mason-nvim-dap.nvim/blob/main/lua/mason-nvim-dap/mappings/source.lua
157174--- @type string[]
158175settings [" dap_deps" ] = {
@@ -242,4 +259,58 @@ settings["dashboard_image"] = {
242259 [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⠿⢿⠿⠷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]] ,
243260}
244261
245- return require (" modules.utils" ).extend_config (settings , " user.settings" )
262+ local merged = require (" modules.utils" ).extend_config (settings , " user.settings" )
263+
264+ -- Migration guard: the discovery-first refactor removed this key; a stale
265+ -- user/settings.lua would merge it in and feed nothing — its servers would
266+ -- vanish without a word.
267+ if merged .external_lsp_deps ~= nil then
268+ -- The removed setting was a MAP of server name -> executable name, but a
269+ -- stale override can survive in any shape: classify before advising so the
270+ -- guidance never presents numeric indices as keys, never drops entries a
271+ -- half-migrated LIST residue still carries, and always names the final
272+ -- step (deleting the dead key). Neither group suppresses the other.
273+ local string_keys , list_items = {}, {}
274+ if type (merged .external_lsp_deps ) == " table" then
275+ for k , v in pairs (merged .external_lsp_deps ) do
276+ if type (k ) == " string" then
277+ string_keys [# string_keys + 1 ] = k
278+ elseif type (k ) == " number" and type (v ) == " string" then
279+ list_items [# list_items + 1 ] = v
280+ end
281+ end
282+ table.sort (string_keys )
283+ table.sort (list_items )
284+ end
285+ local guidance
286+ if # string_keys > 0 and # list_items > 0 then
287+ guidance = " Move its KEYS ("
288+ .. table.concat (string_keys , " , " )
289+ .. " ) AND its list entries ("
290+ .. table.concat (list_items , " , " )
291+ .. " )\n — all of them server names — into `lsp_deps`, then delete `external_lsp_deps`."
292+ elseif # string_keys > 0 then
293+ guidance = " Move its KEYS ("
294+ .. table.concat (string_keys , " , " )
295+ .. " ) — the server names, not the\n "
296+ .. " executable values — into `lsp_deps`, then delete `external_lsp_deps`."
297+ elseif # list_items > 0 then
298+ guidance = " It now holds a LIST ("
299+ .. table.concat (list_items , " , " )
300+ .. " ) — those are already the\n "
301+ .. " server names; move them into `lsp_deps` and delete `external_lsp_deps`."
302+ else
303+ guidance = " It is empty or not a map — delete `external_lsp_deps` from user/settings.lua."
304+ end
305+ -- (Scheduled: the notifier plugin isn't loaded this early; the default
306+ -- notify still lands in :messages.)
307+ vim .schedule (function ()
308+ vim .notify (
309+ " `external_lsp_deps` was removed: non-Mason servers are now discovered\n from $PATH. " .. guidance ,
310+ vim .log .levels .WARN ,
311+ { title = " core.settings" }
312+ )
313+ end )
314+ end
315+
316+ return merged
0 commit comments