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.lsp

nx.lsp.config(name, opts)

nx.lsp.config(name, opts): accumulate opts into name’s override layer (deep-merged over any prior call — configs compose across files and plugins). "*" is the all-clients base inherited by every server. Function-call form only: there is no nx.lsp.config[name] = {…} table-assignment sugar.

Defined in lsp.lua.

nx.lsp.enable(names)

nx.lsp.enable(names): mark configs for auto-activation on current and future buffers and install the dispatcher. names is a string or a list. "*" is the base layer, not an activatable server, so it is rejected here.

Defined in lsp.lua.

nx.lsp.disable(names)

nx.lsp.disable(names): the inverse of enable — future buffers won’t start the named servers (already-running servers keep serving until their buffers close).

Defined in lsp.lua.

nx.lsp.start(cfg, opts)

nx.lsp.start(cfg, opts): the low-level, un-merged direct start (the raw LspOp::Start) for advanced/manual use — bypasses the registry. cfg is a resolved config ({ name, cmd, root_dir, filetypes, settings, … }); opts.bufnr is the buffer to attach (default the current one), opts.filetype its languageId.

Defined in lsp.lua.

nx.lsp.definition()

Each verb queues an LspOp the server drains on the same input tick (reading the cursor where the key fired) and routes into its existing surface: a single location jumps, many open the loclist; hover/signature open the cursor float; code actions open the select menu; format/rename apply edits. There is no reply handling in Lua. The verbs are bare (no implicit args) so nx.keymap.set("n", "gd", nx.lsp.definition) works. kind ints mirror LspReqKind::as_u16 (crates/nxvim-server/src/lsp/mod.rs) — keep the two in step.

Defined in lsp.lua.

nx.lsp.declaration()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.type_definition()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.implementation()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.references()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.hover()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.signature_help()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.signature_help_autotrigger(enable)

nx.lsp.signature_help_autotrigger(enable): opt into auto-showing signature help as you type a call (after (, refreshed at each ,), instead of only on <C-k>. It is driven by the server’s advertised signatureHelpProvider.triggerCharacters, so it only fires for servers that offer signature help. enable defaults to true; pass false to turn it back off. Off unless a config opts in.

Defined in lsp.lua.

nx.lsp.format()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.code_action()

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.document_symbol()

nx.lsp.document_symbol(): the symbols defined in the current document, opened in nx.picker (kind 16 mirrors LspReqKind::DocumentSymbol::as_u16).

Defined in lsp.lua.

nx.lsp.workspace_symbol(query)

nx.lsp.workspace_symbol(query): symbols across the workspace matching query, opened in nx.picker. With no query, prompt for one via nx.ui.input (non-blocking) — an empty/cancelled prompt does nothing.

Defined in lsp.lua.

nx.lsp.rename(new_name)

nx.lsp.rename(new_name): rename the symbol under the cursor. With a name, request it straight away; with none (the bare nx.keymap.set("n", "<leader>rn", nx.lsp.rename) case), prompt for it via nx.ui.input (non-blocking promise), prefilled with the symbol under the cursor, and rename on confirm. An empty / cancelled prompt does nothing.

Defined in lsp.lua.

nx.lsp.clients(filter)

nx.lsp.clients(filter): a snapshot list of active clients, narrowable by filter.bufnr (the clients attached to that buffer; 0/nil = current) and/or filter.name (the config name). Reads the mirror — no request is issued.

Defined in lsp.lua.

nx.lsp.request(method, params, handler, bufnr)

nx.lsp.request(method, params, handler, bufnr): sugar resolving the buffer’s primary client and issuing client:request. No attached client fails loud.

Defined in lsp.lua.

nx.lsp.notify(method, params, bufnr)

nx.lsp.notify(method, params, bufnr): the fire-and-forget sibling of request.

Defined in lsp.lua.

nx.lsp.semantic_tokens.start(bufnr)

start/stop the per-buffer semantic-token paint (neovim’s start/stop verbs).

Defined in lsp.lua.

nx.lsp.semantic_tokens.stop(bufnr)

No documentation comment in the prelude.

Defined in lsp.lua.

nx.lsp.semantic_tokens.enable(enabled)

nxvim’s editor-wide gate (default on) — neovim has only the per-buffer verbs. Off ⇒ no semantic paint anywhere; flipping back on re-requests every buffer.

Defined in lsp.lua.

nx.lsp.semantic_tokens.force_refresh(bufnr)

Drop the cached result_id and re-request the whole token set (neovim’s force_refresh) — the one operation with no readable state to model as a noun.

Defined in lsp.lua.

nx.lsp.semantic_tokens.get_at_pos(bufnr, row, col)

get_at_pos(bufnr, row, col): the decoded tokens covering the 0-based (row, col) (neovim’s vim.lsp.semantic_tokens.get_at_pos). col is a 0-based byte column; a token covers [start_col, end_col). Returns a list (possibly empty).

Defined in lsp.lua.

nx.lsp.inlay_hint.enable(enable, filter)

enable(enable?, filter?): flip the per-buffer inlay-hint paint. enable defaults to true; filter.bufnr (0/nil = current) targets the buffer (neovim’s modern vim.lsp.inlay_hint.enable(enable, { bufnr })).

Defined in lsp.lua.

nx.lsp.inlay_hint.is_enabled(filter)

is_enabled(filter?): whether inlay hints are on for the buffer.

Defined in lsp.lua.

nx.lsp.inlay_hint.get(filter)

get(filter?): the decoded inlay hints in a buffer (filter.bufnr, 0/nil = current), each { bufnr, client_id, inlay_hint = <decoded entry> } to match neovim’s shape. filter.range ({ start_line, end_line }, 0-based inclusive) narrows by line. Reads the mirror — no request is issued.

Defined in lsp.lua.

nx.lsp.foldexpr(_lnum)

nx.lsp.foldexpr is the canonical LSP foldexpr, the foldmethod=expr fold source backed by textDocument/foldingRange:

nx.bo.foldmethod = "expr"
nx.bo.foldexpr   = "v:lua.nx.lsp.foldexpr()"

nxvim recognizes that exact reference and folds the buffer from the language server’s folding ranges (requested on open/change while the buffer wants LSP folds — see crates/nxvim-core/src/editor/fold.rs and crates/nxvim-server’s lsp/folding.rs). Like the tree-sitter marker it is never evaluated per line, so calling it directly is a usage error — fail loud rather than return a wrong level. vim.lsp.foldexpr is the muscle-memory alias; nxvim recognizes both.

Defined in lsp.lua.