Merge pull request #15142 from neovim/marvim/api-doc-update/master

docs: regenerate
This commit is contained in:
Thomas Vigouroux
2021-07-27 11:28:04 +02:00
committed by GitHub
3 changed files with 167 additions and 130 deletions

View File

@@ -2334,9 +2334,8 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
inserted (true for right, false for left).
Defaults to false.
• priority: a priority value for the highlight
group. Default: 4096. For example, treesitter
highlighting uses a default value of 100 (see
|lua-treesitter-highlight-priority|).
group. For example treesitter highlighting
uses a value of 100.
Return: ~
Id of the created/updated extmark

View File

@@ -828,35 +828,37 @@ start_client({config}) *vim.lsp.start_client()*
table.
Parameters: ~
{root_dir} (required, string) Directory where the
LSP server will base its rootUri on
initialization.
{cmd} (required, string or list treated like
|jobstart()|) Base command that
{root_dir} (required, string) Directory where
the LSP server will base its rootUri
on initialization.
{cmd} (required, string or list treated
like |jobstart()|) Base command that
initiates the LSP client.
{cmd_cwd} (string, default=|getcwd()|) Directory
to launch the `cmd` process. Not
related to `root_dir` .
{cmd_cwd} (string, default=|getcwd()|)
Directory to launch the `cmd`
process. Not related to `root_dir` .
{cmd_env} (table) Environment flags to pass to
the LSP on spawn. Can be specified
using keys like a map or as a list with `k=v` pairs or both. Non-string values are
using keys like a map or as a list
with `k=v` pairs or both. Non-string values are
coerced to string. Example: >
{ "PRODUCTION=true"; "TEST=123"; PORT = 8080; HOST = "0.0.0.0"; }
<
{capabilities} Map overriding the default capabilities
defined by
{capabilities} Map overriding the default
capabilities defined by
|vim.lsp.protocol.make_client_capabilities()|,
passed to the language server on
initialization. Hint: use
make_client_capabilities() and modify
its result.
• Note: To send an empty dictionary use
• Note: To send an empty dictionary
use
`{[vim.type_idx]=vim.types.dictionary}`
, else it will be encoded as an
array.
{handlers} Map of language server method names to
|lsp-handler|
{handlers} Map of language server method names
to |lsp-handler|
{settings} Map with language server specific
settings. These are returned to the
language server if requested via
@@ -865,14 +867,20 @@ start_client({config}) *vim.lsp.start_client()*
{init_options} Values to pass in the initialization
request as `initializationOptions` .
See `initialize` in the LSP spec.
{name} (string, default=client-id) Name in log
messages.
{name} (string, default=client-id) Name in
log messages.
{workspace_folders} (table) List of workspace folders
passed to the language server.
Defaults to root_dir if not set. See
`workspaceFolders` in the LSP spec
{get_language_id} function(bufnr, filetype) -> language
ID as string. Defaults to the filetype.
ID as string. Defaults to the
filetype.
{offset_encoding} (default="utf-16") One of "utf-8",
"utf-16", or "utf-32" which is the
encoding that the LSP server expects.
Client does not verify this is correct.
Client does not verify this is
correct.
{on_error} Callback with parameters (code, ...),
invoked when the client operation
throws an error. `code` is a number
@@ -885,20 +893,20 @@ start_client({config}) *vim.lsp.start_client()*
{before_init} Callback with parameters
(initialize_params, config) invoked
before the LSP "initialize" phase,
where `params` contains the parameters
being sent to the server and `config`
is the config that was passed to
|vim.lsp.start_client()|. You can use
this to modify parameters before they
are sent.
where `params` contains the
parameters being sent to the server
and `config` is the config that was
passed to |vim.lsp.start_client()|.
You can use this to modify parameters
before they are sent.
{on_init} Callback (client, initialize_result)
invoked after LSP "initialize", where
`result` is a table of `capabilities`
and anything else the server may send.
For example, clangd sends
and anything else the server may
send. For example, clangd sends
`initialize_result.offsetEncoding` if
`capabilities.offsetEncoding` was sent
to it. You can only modify the
`capabilities.offsetEncoding` was
sent to it. You can only modify the
`client.offset_encoding` here before
any notifications are sent. Most
language servers expect to be sent
@@ -911,21 +919,21 @@ start_client({config}) *vim.lsp.start_client()*
{on_exit} Callback (code, signal, client_id)
invoked on client exit.
• code: exit code of the process
• signal: number describing the signal
used to terminate (if any)
• signal: number describing the
signal used to terminate (if any)
• client_id: client handle
{on_attach} Callback (client, bufnr) invoked when
client attaches to a buffer.
{trace} "off" | "messages" | "verbose" | nil
passed directly to the language server
in the initialize request.
passed directly to the language
server in the initialize request.
Invalid/empty values will default to
"off"
{flags} A table with flags for the client. The
current (experimental) flags are:
• allow_incremental_sync (bool, default
true): Allow using incremental sync
for buffer edits
{flags} A table with flags for the client.
The current (experimental) flags are:
• allow_incremental_sync (bool,
default true): Allow using
incremental sync for buffer edits
• debounce_text_changes (number,
default nil): Debounce didChange
notifications to the server by the
@@ -1200,6 +1208,34 @@ workspace_symbol({query}) *vim.lsp.buf.workspace_symbol()*
==============================================================================
Lua module: vim.lsp.diagnostic *lsp-diagnostic*
*vim.lsp.diagnostic.apply_to_diagnostic_items()*
apply_to_diagnostic_items({item_handler}, {command}, {opts})
Gets diagnostics, converts them to quickfix/location list
items, and applies the item_handler callback to the items.
Parameters: ~
{item_handler} function Callback to apply to the
diagnostic items
{command} string|nil Command to execute after
applying the item_handler
{opts} table|nil Configuration table. Keys:
• {client_id}: (number)
• If nil, will consider all clients
attached to buffer.
• {severity}: (DiagnosticSeverity)
• Exclusive severity to consider.
Overrides {severity_limit}
• {severity_limit}: (DiagnosticSeverity)
• Limit severity of diagnostics found.
E.g. "Warning" means { "Error",
"Warning" } will be valid.
• {workspace}: (boolean, default false)
• Set the list with workspace
diagnostics
*vim.lsp.diagnostic.clear()*
clear({bufnr}, {client_id}, {diagnostic_ns}, {sign_ns})
Clears the currently displayed diagnostics
@@ -1482,30 +1518,6 @@ save({diagnostics}, {bufnr}, {client_id}) *vim.lsp.diagnostic.save()*
save_extmarks({bufnr}, {client_id})
TODO: Documentation
set_qflist({opts}) *vim.lsp.diagnostic.set_qflist()*
Sets the quickfix list
Parameters: ~
{opts} table|nil Configuration table. Keys:
• {open}: (boolean, default true)
• Open quickfix list after set
• {client_id}: (number)
• If nil, will consider all clients attached to
buffer.
• {severity}: (DiagnosticSeverity)
• Exclusive severity to consider. Overrides
{severity_limit}
• {severity_limit}: (DiagnosticSeverity)
• Limit severity of diagnostics found. E.g.
"Warning" means { "Error", "Warning" } will be
valid.
• {workspace}: (boolean, default true)
• Set the list with workspace diagnostics
set_loclist({opts}) *vim.lsp.diagnostic.set_loclist()*
Sets the location list
@@ -1530,6 +1542,30 @@ set_loclist({opts}) *vim.lsp.diagnostic.set_loclist()*
• {workspace}: (boolean, default false)
• Set the list with workspace diagnostics
set_qflist({opts}) *vim.lsp.diagnostic.set_qflist()*
Sets the quickfix list
Parameters: ~
{opts} table|nil Configuration table. Keys:
• {open}: (boolean, default true)
• Open quickfix list after set
• {client_id}: (number)
• If nil, will consider all clients attached to
buffer.
• {severity}: (DiagnosticSeverity)
• Exclusive severity to consider. Overrides
{severity_limit}
• {severity_limit}: (DiagnosticSeverity)
• Limit severity of diagnostics found. E.g.
"Warning" means { "Error", "Warning" } will be
valid.
• {workspace}: (boolean, default true)
• Set the list with workspace diagnostics
*vim.lsp.diagnostic.set_signs()*
set_signs({diagnostics}, {bufnr}, {client_id}, {sign_ns}, {opts})
Set signs for given diagnostics

View File

@@ -519,9 +519,11 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
for id, node in pairs(match) do
local name = query.captures[id]
-- `node` was captured by the `name` capture in the match
<
>
local node_data = metadata[id] -- Node level metadata
<
>
... use the info here ...
end
end