@@ -96,10 +96,11 @@ return function()
9696 vim .fn .sign_define (" DapLogPoint" , { text = icons .dap .LogPoint , texthl = " DapLogPoint" , linehl = " " , numhl = " " })
9797
9898 -- Everything Mason-flavored loads LAZILY: a session where every adapter
99- -- self-validates from $PATH must not load mason.nvim / mason-nvim-dap on
100- -- the :Dap* tick. First use (the factory fallback or a phase-2
101- -- classification) goes through lazy.nvim's module loader; absence degrades
102- -- to client-config/$PATH resolution as before.
99+ -- self-validates from $PATH — with no user overrides — must not load
100+ -- mason.nvim / mason-nvim-dap on the :Dap* tick. First use (the factory
101+ -- fallback, a phase-2 classification, or a user override's opts
102+ -- materialization) goes through lazy.nvim's module loader; absence
103+ -- degrades to client-config/$PATH resolution as before.
103104 local mason_dap = nil
104105 local function mason_dap_mod ()
105106 if mason_dap == nil then
@@ -160,15 +161,16 @@ return function()
160161 end
161162
162163 --- A handler to setup all clients defined under `tool/dap/clients/*.lua`.
163- --- Only the factory branch touches mason-nvim-dap: a client-config'd adapter
164- --- (every adapter in this repo) configures without loading Mason.
164+ --- The factory branch and a user override's opts materialization load
165+ --- mason-nvim-dap; a repo zero-arg client (every adapter in this repo)
166+ --- configures without loading Mason.
165167 --- @param dap_name string
166168 local function mason_dap_handler (dap_name )
167169 local custom_handler , broken_reason , _ , user_won = load_client_config (dap_name )
168170 -- No-fall-through contract, enforced by the ONE shared implementation
169- -- (tools.usable_or_raise, also used by mason_lsp_handler ): a broken or
170- -- wrong-shaped config must never read as success — that would suppress
171- -- both the warning and the install fallback.
171+ -- (tools.usable_or_raise): a broken or wrong-shaped config must never
172+ -- read as success — that would suppress both the warning and the
173+ -- install fallback.
172174 custom_handler = tools .usable_or_raise (custom_handler , broken_reason , {
173175 label = " client config" ,
174176 expected = " a fun(opts)" ,
@@ -217,9 +219,10 @@ return function()
217219 )
218220 end
219221 -- Partial mappings drift can hand us configurations without
220- -- filetypes (or vice versa); default_setup ipairs() both
221- -- unconditionally. Degrade to whatever half is present instead of
222- -- a raw ipairs(nil) raise.
222+ -- filetypes: upstream's default_setup guards configurations
223+ -- (`or {}`) but ipairs()es filetypes whenever configurations are
224+ -- non-empty — that combination raises ipairs(nil). Normalize both
225+ -- halves defensively.
223226 if type (config .configurations ) ~= " table" then
224227 config .configurations = {}
225228 end
@@ -345,8 +348,8 @@ return function()
345348 -- install fallback — python resolves debugpy from a venv $PATH can't see.
346349 -- The raise on a missing launch binary is the provisioning signal.
347350 --
348- -- CANONICAL availability contract for dap/clients/*.lua (referenced by the
349- -- one-line notes in each client ; keep the two patterns in sync here ).
351+ -- CANONICAL availability contract for dap/clients/*.lua (the raise-LAST
352+ -- clients carry pointer notes back here ; keep the two patterns in sync).
350353 -- Shape enforcement itself lives in tools.usable_or_raise; a
351354 -- metadata-declared contract ({ attach_capable, binaries }) was
352355 -- considered and rejected — it would churn the fun(opts) user-override
0 commit comments