Skip to content

Commit 5fe136c

Browse files
committed
docs: regenerate
1 parent a8c3d50 commit 5fe136c

File tree

1 file changed

+144
-108
lines changed

1 file changed

+144
-108
lines changed

runtime/doc/lsp.txt

Lines changed: 144 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -816,109 +816,117 @@ start_client({config}) *vim.lsp.start_client()*
816816
table.
817817

818818
Parameters: ~
819-
{root_dir} (required, string) Directory where the
820-
LSP server will base its rootUri on
821-
initialization.
822-
{cmd} (required, string or list treated like
823-
|jobstart()|) Base command that
824-
initiates the LSP client.
825-
{cmd_cwd} (string, default=|getcwd()|) Directory
826-
to launch the `cmd` process. Not
827-
related to `root_dir` .
828-
{cmd_env} (table) Environment flags to pass to
829-
the LSP on spawn. Can be specified
830-
using keys like a map or as a list with `k=v` pairs or both. Non-string values are
831-
coerced to string. Example: >
819+
{root_dir} (required, string) Directory where
820+
the LSP server will base its rootUri
821+
on initialization.
822+
{cmd} (required, string or list treated
823+
like |jobstart()|) Base command that
824+
initiates the LSP client.
825+
{cmd_cwd} (string, default=|getcwd()|)
826+
Directory to launch the `cmd`
827+
process. Not related to `root_dir` .
828+
{cmd_env} (table) Environment flags to pass to
829+
the LSP on spawn. Can be specified
830+
using keys like a map or as a list
831+
with `k=v` pairs or both. Non-string values are
832+
coerced to string. Example: >
832833
833834
{ "PRODUCTION=true"; "TEST=123"; PORT = 8080; HOST = "0.0.0.0"; }
834835
<
835-
{capabilities} Map overriding the default capabilities
836-
defined by
837-
|vim.lsp.protocol.make_client_capabilities()|,
838-
passed to the language server on
839-
initialization. Hint: use
840-
make_client_capabilities() and modify
841-
its result.
842-
• Note: To send an empty dictionary use
843-
`{[vim.type_idx]=vim.types.dictionary}`
844-
, else it will be encoded as an
845-
array.
846-
{handlers} Map of language server method names to
847-
|lsp-handler|
848-
{settings} Map with language server specific
849-
settings. These are returned to the
850-
language server if requested via
851-
`workspace/configuration` . Keys are
852-
case-sensitive.
853-
{init_options} Values to pass in the initialization
854-
request as `initializationOptions` .
855-
See `initialize` in the LSP spec.
856-
{name} (string, default=client-id) Name in log
857-
messages.
858-
{get_language_id} function(bufnr, filetype) -> language
859-
ID as string. Defaults to the filetype.
860-
{offset_encoding} (default="utf-16") One of "utf-8",
861-
"utf-16", or "utf-32" which is the
862-
encoding that the LSP server expects.
863-
Client does not verify this is correct.
864-
{on_error} Callback with parameters (code, ...),
865-
invoked when the client operation
866-
throws an error. `code` is a number
867-
describing the error. Other arguments
868-
may be passed depending on the error
869-
kind. See |vim.lsp.client_errors| for
870-
possible errors. Use
871-
`vim.lsp.client_errors[code]` to get
872-
human-friendly name.
873-
{before_init} Callback with parameters
874-
(initialize_params, config) invoked
875-
before the LSP "initialize" phase,
876-
where `params` contains the parameters
877-
being sent to the server and `config`
878-
is the config that was passed to
879-
|vim.lsp.start_client()|. You can use
880-
this to modify parameters before they
881-
are sent.
882-
{on_init} Callback (client, initialize_result)
883-
invoked after LSP "initialize", where
884-
`result` is a table of `capabilities`
885-
and anything else the server may send.
886-
For example, clangd sends
887-
`initialize_result.offsetEncoding` if
888-
`capabilities.offsetEncoding` was sent
889-
to it. You can only modify the
890-
`client.offset_encoding` here before
891-
any notifications are sent. Most
892-
language servers expect to be sent
893-
client specified settings after
894-
initialization. Neovim does not make
895-
this assumption. A
896-
`workspace/didChangeConfiguration`
897-
notification should be sent to the
898-
server during on_init.
899-
{on_exit} Callback (code, signal, client_id)
900-
invoked on client exit.
901-
• code: exit code of the process
902-
• signal: number describing the signal
903-
used to terminate (if any)
904-
• client_id: client handle
905-
{on_attach} Callback (client, bufnr) invoked when
906-
client attaches to a buffer.
907-
{trace} "off" | "messages" | "verbose" | nil
908-
passed directly to the language server
909-
in the initialize request.
910-
Invalid/empty values will default to
911-
"off"
912-
{flags} A table with flags for the client. The
913-
current (experimental) flags are:
914-
• allow_incremental_sync (bool, default
915-
true): Allow using incremental sync
916-
for buffer edits
917-
• debounce_text_changes (number,
918-
default nil): Debounce didChange
919-
notifications to the server by the
920-
given number in milliseconds. No
921-
debounce occurs if nil
836+
{capabilities} Map overriding the default
837+
capabilities defined by
838+
|vim.lsp.protocol.make_client_capabilities()|,
839+
passed to the language server on
840+
initialization. Hint: use
841+
make_client_capabilities() and modify
842+
its result.
843+
• Note: To send an empty dictionary
844+
use
845+
`{[vim.type_idx]=vim.types.dictionary}`
846+
, else it will be encoded as an
847+
array.
848+
{handlers} Map of language server method names
849+
to |lsp-handler|
850+
{settings} Map with language server specific
851+
settings. These are returned to the
852+
language server if requested via
853+
`workspace/configuration` . Keys are
854+
case-sensitive.
855+
{init_options} Values to pass in the initialization
856+
request as `initializationOptions` .
857+
See `initialize` in the LSP spec.
858+
{name} (string, default=client-id) Name in
859+
log messages.
860+
{workspace_folders} (table) List of workspace folders
861+
passed to the language server.
862+
Defaults to root_dir if not set. See
863+
`workspaceFolders` in the LSP spec
864+
{get_language_id} function(bufnr, filetype) -> language
865+
ID as string. Defaults to the
866+
filetype.
867+
{offset_encoding} (default="utf-16") One of "utf-8",
868+
"utf-16", or "utf-32" which is the
869+
encoding that the LSP server expects.
870+
Client does not verify this is
871+
correct.
872+
{on_error} Callback with parameters (code, ...),
873+
invoked when the client operation
874+
throws an error. `code` is a number
875+
describing the error. Other arguments
876+
may be passed depending on the error
877+
kind. See |vim.lsp.client_errors| for
878+
possible errors. Use
879+
`vim.lsp.client_errors[code]` to get
880+
human-friendly name.
881+
{before_init} Callback with parameters
882+
(initialize_params, config) invoked
883+
before the LSP "initialize" phase,
884+
where `params` contains the
885+
parameters being sent to the server
886+
and `config` is the config that was
887+
passed to |vim.lsp.start_client()|.
888+
You can use this to modify parameters
889+
before they are sent.
890+
{on_init} Callback (client, initialize_result)
891+
invoked after LSP "initialize", where
892+
`result` is a table of `capabilities`
893+
and anything else the server may
894+
send. For example, clangd sends
895+
`initialize_result.offsetEncoding` if
896+
`capabilities.offsetEncoding` was
897+
sent to it. You can only modify the
898+
`client.offset_encoding` here before
899+
any notifications are sent. Most
900+
language servers expect to be sent
901+
client specified settings after
902+
initialization. Neovim does not make
903+
this assumption. A
904+
`workspace/didChangeConfiguration`
905+
notification should be sent to the
906+
server during on_init.
907+
{on_exit} Callback (code, signal, client_id)
908+
invoked on client exit.
909+
• code: exit code of the process
910+
• signal: number describing the
911+
signal used to terminate (if any)
912+
• client_id: client handle
913+
{on_attach} Callback (client, bufnr) invoked when
914+
client attaches to a buffer.
915+
{trace} "off" | "messages" | "verbose" | nil
916+
passed directly to the language
917+
server in the initialize request.
918+
Invalid/empty values will default to
919+
"off"
920+
{flags} A table with flags for the client.
921+
The current (experimental) flags are:
922+
• allow_incremental_sync (bool,
923+
default true): Allow using
924+
incremental sync for buffer edits
925+
• debounce_text_changes (number,
926+
default nil): Debounce didChange
927+
notifications to the server by the
928+
given number in milliseconds. No
929+
debounce occurs if nil
922930

923931
Return: ~
924932
Client id. |vim.lsp.get_client_by_id()| Note: client may
@@ -1188,6 +1196,34 @@ workspace_symbol({query}) *vim.lsp.buf.workspace_symbol()*
11881196
==============================================================================
11891197
Lua module: vim.lsp.diagnostic *lsp-diagnostic*
11901198

1199+
*vim.lsp.diagnostic.apply_to_diagnostic_items()*
1200+
apply_to_diagnostic_items({item_handler}, {command}, {opts})
1201+
Gets diagnostics, converts them to quickfix/location list
1202+
items, and applies the item_handler callback to the items.
1203+
1204+
Parameters: ~
1205+
{item_handler} function Callback to apply to the
1206+
diagnostic items
1207+
{command} string|nil Command to execute after
1208+
applying the item_handler
1209+
{opts} table|nil Configuration table. Keys:
1210+
• {client_id}: (number)
1211+
• If nil, will consider all clients
1212+
attached to buffer.
1213+
1214+
{severity}: (DiagnosticSeverity)
1215+
• Exclusive severity to consider.
1216+
Overrides {severity_limit}
1217+
1218+
• {severity_limit}: (DiagnosticSeverity)
1219+
• Limit severity of diagnostics found.
1220+
E.g. "Warning" means { "Error",
1221+
"Warning" } will be valid.
1222+
1223+
{workspace}: (boolean, default false)
1224+
• Set the list with workspace
1225+
diagnostics
1226+
11911227
*vim.lsp.diagnostic.clear()*
11921228
clear({bufnr}, {client_id}, {diagnostic_ns}, {sign_ns})
11931229
Clears the currently displayed diagnostics
@@ -1470,13 +1506,13 @@ save({diagnostics}, {bufnr}, {client_id}) *vim.lsp.diagnostic.save()*
14701506
save_extmarks({bufnr}, {client_id})
14711507
TODO: Documentation
14721508

1473-
set_qflist({opts}) *vim.lsp.diagnostic.set_qflist()*
1474-
Sets the quickfix list
1509+
set_loclist({opts}) *vim.lsp.diagnostic.set_loclist()*
1510+
Sets the location list
14751511

14761512
Parameters: ~
14771513
{opts} table|nil Configuration table. Keys:
14781514
{open}: (boolean, default true)
1479-
• Open quickfix list after set
1515+
• Open loclist after set
14801516

14811517
• {client_id}: (number)
14821518
• If nil, will consider all clients attached to
@@ -1491,16 +1527,16 @@ set_qflist({opts}) *vim.lsp.diagnostic.set_qflist()*
14911527
"Warning" means { "Error", "Warning" } will be
14921528
valid.
14931529

1494-
{workspace}: (boolean, default true)
1530+
{workspace}: (boolean, default false)
14951531
• Set the list with workspace diagnostics
14961532

1497-
set_loclist({opts}) *vim.lsp.diagnostic.set_loclist()*
1498-
Sets the location list
1533+
set_qflist({opts}) *vim.lsp.diagnostic.set_qflist()*
1534+
Sets the quickfix list
14991535

15001536
Parameters: ~
15011537
{opts} table|nil Configuration table. Keys:
15021538
{open}: (boolean, default true)
1503-
• Open loclist after set
1539+
• Open quickfix list after set
15041540

15051541
• {client_id}: (number)
15061542
• If nil, will consider all clients attached to
@@ -1515,7 +1551,7 @@ set_loclist({opts}) *vim.lsp.diagnostic.set_loclist()*
15151551
"Warning" means { "Error", "Warning" } will be
15161552
valid.
15171553

1518-
{workspace}: (boolean, default false)
1554+
{workspace}: (boolean, default true)
15191555
• Set the list with workspace diagnostics
15201556

15211557
*vim.lsp.diagnostic.set_signs()*

0 commit comments

Comments
 (0)