nvim_runtime_lua

vim.lsp.diagnostic

Methods5

function M.from(diagnostics: vim.Diagnostic[]) -> lsp.Diagnostic[]

Converts the input vim.Diagnostics to LSP diagnostics.

function M.get_namespace(client_id: integer, is_pull: nil | boolean, pull_id: nil | string) -> integer

Get the diagnostic namespace associated with an LSP client |vim.diagnostic| for diagnostics

Parameters
client_idinteger

The id of the LSP client

is_pullnil | boolean

Whether the namespace is for a pull or push client. Defaults to false (push).

pull_idnil | string

(default: nil) Optional identifier for pull diagnostic providers. Only used if is_pull is true.

Returns
integer
function M.on_publish_diagnostics(_: lsp.ResponseError | nil, params: lsp.PublishDiagnosticsParams, ctx: lsp.HandlerContext) -> nil

|lsp-handler| for the method "textDocument/publishDiagnostics"

See |vim.diagnostic.config()| for configuration options.

function M.on_diagnostic(error: lsp.ResponseError | nil, result: lsp.DocumentDiagnosticReport, ctx: lsp.HandlerContext) -> nil

|lsp-handler| for the method "textDocument/diagnostic"

See |vim.diagnostic.config()| for configuration options.

function M._workspace_diagnostics(opts: vim.lsp.WorkspaceDiagnosticsOpts) -> nil

Request workspace-wide diagnostics.