Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

nx.diagnostic

nx.diagnostic.get(bufnr, opts)

nx.diagnostic.get([bufnr, [opts]]): diagnostics as plain tables. nil bufnr → every buffer; 0 → the current one. opts.severity (a number) filters. The entries are copied out (callers must not mutate the mirror), each tagged with its bufnr, matching neovim’s shape.

Defined in diagnostic.lua.

nx.diagnostic.goto_next(opts)

No documentation comment in the prelude.

Defined in diagnostic.lua.

nx.diagnostic.goto_prev(opts)

No documentation comment in the prelude.

Defined in diagnostic.lua.

nx.diagnostic.toqflist(diagnostics)

nx.diagnostic.toqflist(diagnostics): convert a list of diagnostic tables (the shape nx.diagnostic.get returns) into quickfix/location-list items. Mirrors neovim’s vim.diagnostic.toqflist: 0-based diagnostic positions become 1-based list columns, the message becomes the entry text, and severity maps to the type char. The buffer name is resolved into filename so the entry is jumpable.

Defined in diagnostic.lua.

nx.diagnostic.setqflist(opts)

nx.diagnostic.setqflist([opts]): replace the quickfix list with every buffer’s diagnostics and (unless opts.open == false) open the quickfix window. opts: severity filter, title, open.

Defined in diagnostic.lua.

nx.diagnostic.setloclist(opts)

nx.diagnostic.setloclist([opts]): populate the current window’s location list with the current buffer’s diagnostics (a real, navigable loclist now that one exists) and open it. opts: bufnr (default current), severity, title, open.

Defined in diagnostic.lua.

nx.diagnostic.open_float(_opts)

nx.diagnostic.open_float([opts]): open a float listing the cursor line’s diagnostics in full (the multi-line messages with source/code that the inline virtual text truncates). The server reads the cursor at apply time and routes through the float surface (the bottom panel hover uses); a clean line opens nothing. opts (scope/severity filters, formatting) is not yet honored — the default cursor-line scope is what nxvim shows.

Defined in diagnostic.lua.

nx.diagnostic.config(opts, _namespace)

No documentation comment in the prelude.

Defined in diagnostic.lua.

nx.diagnostic.set(namespace, bufnr, diagnostics, _opts)

nx.diagnostic.set(namespace, bufnr, diagnostics[, opts]): replace the diagnostics for (namespace, bufnr). bufnr 0 means the current buffer. The entries are stored as given (each typically { lnum, col, message, severity }); opts (display overrides) is accepted but not yet honored — see the INCOMPLETE note on nx._diagnostics_ns. A plugin drives its own buffer’s diagnostics through this.

Defined in diagnostic.lua.

nx.diagnostic.reset(namespace, bufnr)

nx.diagnostic.reset([namespace, [bufnr]]): clear client-set diagnostics. With no args, every namespace in every buffer; with a namespace, that namespace in every buffer (or just bufnr when given). A plugin calls this when its float closes — it used to crash because the function was missing.

Defined in diagnostic.lua.