4. LSP options

LSP is provided by the :lsp layer (enabled by default). Layer defaults live in coxn.layers.lsp; timeout defaults live in core default-options.

4.1 Behavior switches

OptionDefaultMeaning
:lsp-autotrueAutomatically attach when opening a file with a matching server (-Dcoxn.lsp.auto=false changes the default). Use M-x lsp to attach manually
:lsp-auto-installtrueIf a server is not on PATH, asynchronously install it from its official source (GitHub releases / Eclipse / npm) under <config>/lsp/<name> and retry. Use M-x lsp-install-server manually
:lsp-confirm-editstrueShow a diff preview for WorkspaceEdit operations such as rename; apply only with C-c C-c
:lsp-on-type-formattingtrueAfter a trigger character (such as clangd's . or ;), format automatically when the server requests it
:lsp-code-action-lighttrueWhen the point has diagnostics and typing pauses for 500 ms, show 💡 in the mode line when a code action is available
:lsp-inlay-hintsfalseInlay hints (types / parameter names). Toggle M-x lsp-inlay-hints-mode (M-m m T i)

4.2 Timeouts

OptionDefaultMeaning
:lsp-timeout-ms3000Timeout for synchronous requests such as jump to definition, rename, formatting, and completion
:lsp-eldoc-delay-ms300Idle delay before asking for function hints (shared by nREPL and LSP)
:lsp-sync-wait-ms200Initial synchronous wait for user-command requests. If the reply arrives, show it immediately; otherwise switch to asynchronous handling (bounded by :lsp-timeout-ms)
:lsp-file-operation-timeout-ms1500Maximum wait for server willRename / willDelete edits before renaming or deleting a file; on timeout, proceed without those edits

4.3 Servers and server settings (no defaults; configure as needed)

OptionMeaning
:lsp-servers{major-mode [[command arguments…] …]}, merged with each language layer's built-in list (same-mode entries override). The first installed command is used. :workspace-dir in arguments becomes <cache>/lsp/<command>/<project-root-hash> (jdtls needs it). Example: (set-option! :lsp-servers {:c++ [["clangd" "--background-index" "--clang-tidy"]]})
:lsp-settings{server-command settings-map}, deep-merged over built-in defaults and sent to initializationOptions.settings, workspace/didChangeConfiguration, and workspace/configuration. Built-ins include jdtls (inlay-hint parameter names) and useful typescript-language-server settings. Example: (set-option! :lsp-settings {"jdtls" {:java {:inlayHints {:parameterNames {:enabled "all"}}}}})
:lsp-init-options{major-mode initializationOptions}, sent additionally during initialize
:lsp-connect(fn [mode root]) returning a fake {:in :out :process} connection, for tests only; normally leave unset

Raw Markdown: coxn manual (Markdown) · Installers: coxn product page