mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
docs: regenerate (#16468)
Co-authored-by: marvim <marvim@users.noreply.github.com>
This commit is contained in:
parent
0a1391fdd7
commit
4393360796
@ -1018,7 +1018,7 @@ nvim_get_mode() *nvim_get_mode()*
|
|||||||
{fast}
|
{fast}
|
||||||
|
|
||||||
nvim_get_option({name}) *nvim_get_option()*
|
nvim_get_option({name}) *nvim_get_option()*
|
||||||
Gets an option value string.
|
Gets the global value of an option.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{name} Option name
|
{name} Option name
|
||||||
@ -1049,6 +1049,24 @@ nvim_get_option_info({name}) *nvim_get_option_info()*
|
|||||||
Return: ~
|
Return: ~
|
||||||
Option Information
|
Option Information
|
||||||
|
|
||||||
|
nvim_get_option_value({name}, {*opts}) *nvim_get_option_value()*
|
||||||
|
Gets the value of an option. The behavior of this function
|
||||||
|
matches that of |:set|: the local value of an option is
|
||||||
|
returned if it exists; otherwise, the global value is
|
||||||
|
returned. Local values always correspond to the current buffer
|
||||||
|
or window. To get a buffer-local or window-local option for a
|
||||||
|
specific buffer or window, use |nvim_buf_get_option()| or
|
||||||
|
|nvim_win_get_option()|.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{name} Option name
|
||||||
|
{opts} Optional parameters
|
||||||
|
• scope: One of 'global' or 'local'. Analagous to
|
||||||
|
|:setglobal| and |:setlocal|, respectively.
|
||||||
|
|
||||||
|
Return: ~
|
||||||
|
Option value
|
||||||
|
|
||||||
nvim_get_proc({pid}) *nvim_get_proc()*
|
nvim_get_proc({pid}) *nvim_get_proc()*
|
||||||
Gets info describing process `pid` .
|
Gets info describing process `pid` .
|
||||||
|
|
||||||
@ -1510,12 +1528,26 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
|
|||||||
key is an error.
|
key is an error.
|
||||||
|
|
||||||
nvim_set_option({name}, {value}) *nvim_set_option()*
|
nvim_set_option({name}, {value}) *nvim_set_option()*
|
||||||
Sets an option value.
|
Sets the global value of an option.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{name} Option name
|
{name} Option name
|
||||||
{value} New option value
|
{value} New option value
|
||||||
|
|
||||||
|
*nvim_set_option_value()*
|
||||||
|
nvim_set_option_value({name}, {value}, {*opts})
|
||||||
|
Sets the value of an option. The behavior of this function
|
||||||
|
matches that of |:set|: for global-local options, both the
|
||||||
|
global and local value are set unless otherwise specified with
|
||||||
|
{scope}.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{name} Option name
|
||||||
|
{value} New option value
|
||||||
|
{opts} Optional parameters
|
||||||
|
• scope: One of 'global' or 'local'. Analagous to
|
||||||
|
|:setglobal| and |:setlocal|, respectively.
|
||||||
|
|
||||||
nvim_set_var({name}, {value}) *nvim_set_var()*
|
nvim_set_var({name}, {value}) *nvim_set_var()*
|
||||||
Sets a global (g:) variable.
|
Sets a global (g:) variable.
|
||||||
|
|
||||||
|
@ -630,6 +630,12 @@ client() *vim.lsp.client*
|
|||||||
server.
|
server.
|
||||||
• {handlers} (table): The handlers used by the client as
|
• {handlers} (table): The handlers used by the client as
|
||||||
described in |lsp-handler|.
|
described in |lsp-handler|.
|
||||||
|
• {requests} (table): The current pending requests in flight
|
||||||
|
to the server. Entries are key-value pairs with the key
|
||||||
|
being the request ID while the value is a table with
|
||||||
|
`type` , `bufnr` , and `method` key-value pairs. `type` is
|
||||||
|
either "pending" for an active request, or "cancel" for a
|
||||||
|
cancel request.
|
||||||
• {config} (table): copy of the table that was passed by the
|
• {config} (table): copy of the table that was passed by the
|
||||||
user to |vim.lsp.start_client()|.
|
user to |vim.lsp.start_client()|.
|
||||||
• {server_capabilities} (table): Response from the server
|
• {server_capabilities} (table): Response from the server
|
||||||
@ -1326,12 +1332,14 @@ apply_text_document_edit({text_document_edit}, {index})
|
|||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentEdit
|
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentEdit
|
||||||
|
|
||||||
*vim.lsp.util.apply_text_edits()*
|
*vim.lsp.util.apply_text_edits()*
|
||||||
apply_text_edits({text_edits}, {bufnr})
|
apply_text_edits({text_edits}, {bufnr}, {offset_encoding})
|
||||||
Applies a list of text edits to a buffer.
|
Applies a list of text edits to a buffer.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{text_edits} table list of `TextEdit` objects
|
{text_edits} table list of `TextEdit` objects
|
||||||
{bufnr} number Buffer id
|
{bufnr} number Buffer id
|
||||||
|
{offset_encoding} string utf-8|utf-16|utf-32|nil defaults
|
||||||
|
to encoding of first client of `bufnr`
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
|
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
|
||||||
@ -1358,23 +1366,28 @@ buf_highlight_references({bufnr}, {references}, {offset_encoding})
|
|||||||
{references} table List of `DocumentHighlight`
|
{references} table List of `DocumentHighlight`
|
||||||
objects to highlight
|
objects to highlight
|
||||||
{offset_encoding} string One of "utf-8", "utf-16",
|
{offset_encoding} string One of "utf-8", "utf-16",
|
||||||
"utf-32", or nil. Defaults to utf-16
|
"utf-32", or nil. Defaults to
|
||||||
|
`offset_encoding` of first client of
|
||||||
|
`bufnr`
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight
|
https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight
|
||||||
|
|
||||||
*vim.lsp.util.character_offset()*
|
*vim.lsp.util.character_offset()*
|
||||||
character_offset({bufnr}, {row}, {col})
|
character_offset({buf}, {row}, {col}, {offset_encoding})
|
||||||
Returns the UTF-32 and UTF-16 offsets for a position in a
|
Returns the UTF-32 and UTF-16 offsets for a position in a
|
||||||
certain buffer.
|
certain buffer.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{buf} buffer id (0 for current)
|
{buf} buffer id (0 for current)
|
||||||
{row} 0-indexed line
|
{row} 0-indexed line
|
||||||
{col} 0-indexed byte offset in line
|
{col} 0-indexed byte offset in line
|
||||||
|
{offset_encoding} string utf-8|utf-16|utf-32|nil defaults
|
||||||
|
to `offset_encoding` of first client of
|
||||||
|
`buf`
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(number, number) UTF-32 and UTF-16 index of the character
|
(number, number) `offset_encoding` index of the character
|
||||||
in line {row} column {col} in buffer {buf}
|
in line {row} column {col} in buffer {buf}
|
||||||
|
|
||||||
*vim.lsp.util.convert_input_to_markdown_lines()*
|
*vim.lsp.util.convert_input_to_markdown_lines()*
|
||||||
@ -1516,47 +1529,73 @@ make_formatting_params({options})
|
|||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting
|
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting
|
||||||
|
|
||||||
*vim.lsp.util.make_given_range_params()*
|
*vim.lsp.util.make_given_range_params()*
|
||||||
make_given_range_params({start_pos}, {end_pos})
|
make_given_range_params({start_pos}, {end_pos}, {bufnr}, {offset_encoding})
|
||||||
Using the given range in the current buffer, creates an object
|
Using the given range in the current buffer, creates an object
|
||||||
that is similar to |vim.lsp.util.make_range_params()|.
|
that is similar to |vim.lsp.util.make_range_params()|.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{start_pos} ({number, number}, optional) mark-indexed
|
{start_pos} ({number, number}, optional)
|
||||||
position. Defaults to the start of the last
|
mark-indexed position. Defaults to the
|
||||||
visual selection.
|
start of the last visual selection.
|
||||||
{end_pos} ({number, number}, optional) mark-indexed
|
{end_pos} ({number, number}, optional)
|
||||||
position. Defaults to the end of the last
|
mark-indexed position. Defaults to the
|
||||||
visual selection.
|
end of the last visual selection.
|
||||||
|
{bufnr} (optional, number): buffer handle or 0
|
||||||
|
for current, defaults to current
|
||||||
|
{offset_encoding} string utf-8|utf-16|utf-32|nil defaults
|
||||||
|
to `offset_encoding` of first client of
|
||||||
|
`bufnr`
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
{ textDocument = { uri = `current_file_uri` }, range = {
|
{ textDocument = { uri = `current_file_uri` }, range = {
|
||||||
start = `start_position` , end = `end_position` } }
|
start = `start_position` , end = `end_position` } }
|
||||||
|
|
||||||
make_position_params() *vim.lsp.util.make_position_params()*
|
*vim.lsp.util.make_position_params()*
|
||||||
|
make_position_params({window}, {offset_encoding})
|
||||||
Creates a `TextDocumentPositionParams` object for the current
|
Creates a `TextDocumentPositionParams` object for the current
|
||||||
buffer and cursor position.
|
buffer and cursor position.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{window} (optional, number): window handle or 0
|
||||||
|
for current, defaults to current
|
||||||
|
{offset_encoding} string utf-8|utf-16|utf-32|nil defaults
|
||||||
|
to `offset_encoding` of first client of
|
||||||
|
buffer of `window`
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
`TextDocumentPositionParams` object
|
`TextDocumentPositionParams` object
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentPositionParams
|
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentPositionParams
|
||||||
|
|
||||||
make_range_params() *vim.lsp.util.make_range_params()*
|
*vim.lsp.util.make_range_params()*
|
||||||
|
make_range_params({window}, {offset_encoding})
|
||||||
Using the current position in the current buffer, creates an
|
Using the current position in the current buffer, creates an
|
||||||
object that can be used as a building block for several LSP
|
object that can be used as a building block for several LSP
|
||||||
requests, such as `textDocument/codeAction` ,
|
requests, such as `textDocument/codeAction` ,
|
||||||
`textDocument/colorPresentation` ,
|
`textDocument/colorPresentation` ,
|
||||||
`textDocument/rangeFormatting` .
|
`textDocument/rangeFormatting` .
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{window} (optional, number): window handle or 0
|
||||||
|
for current, defaults to current
|
||||||
|
{offset_encoding} string utf-8|utf-16|utf-32|nil defaults
|
||||||
|
to `offset_encoding` of first client of
|
||||||
|
buffer of `window`
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
{ textDocument = { uri = `current_file_uri` }, range = {
|
{ textDocument = { uri = `current_file_uri` }, range = {
|
||||||
start = `current_position` , end = `current_position` } }
|
start = `current_position` , end = `current_position` } }
|
||||||
|
|
||||||
make_text_document_params() *vim.lsp.util.make_text_document_params()*
|
*vim.lsp.util.make_text_document_params()*
|
||||||
|
make_text_document_params({bufnr})
|
||||||
Creates a `TextDocumentIdentifier` object for the current
|
Creates a `TextDocumentIdentifier` object for the current
|
||||||
buffer.
|
buffer.
|
||||||
|
|
||||||
|
Parameters: ~
|
||||||
|
{bufnr} (optional, number): Buffer handle, defaults to
|
||||||
|
current
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
`TextDocumentIdentifier`
|
`TextDocumentIdentifier`
|
||||||
|
|
||||||
|
@ -421,9 +421,9 @@ get_node_text({node}, {source}) *get_node_text()*
|
|||||||
Gets the text corresponding to a given node
|
Gets the text corresponding to a given node
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{node} the node
|
{node} the node
|
||||||
{bsource} The buffer or string from which the node is
|
{source} The buffer or string from which the node is
|
||||||
extracted
|
extracted
|
||||||
|
|
||||||
get_query({lang}, {query_name}) *get_query()*
|
get_query({lang}, {query_name}) *get_query()*
|
||||||
Returns the runtime query {query_name} for {lang}.
|
Returns the runtime query {query_name} for {lang}.
|
||||||
@ -530,11 +530,9 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
|
|||||||
for id, node in pairs(match) do
|
for id, node in pairs(match) do
|
||||||
local name = query.captures[id]
|
local name = query.captures[id]
|
||||||
-- `node` was captured by the `name` capture in the match
|
-- `node` was captured by the `name` capture in the match
|
||||||
<
|
|
||||||
>
|
local node_data = metadata[id] -- Node level metadata
|
||||||
local node_data = metadata[id] -- Node level metadata
|
|
||||||
<
|
|
||||||
>
|
|
||||||
... use the info here ...
|
... use the info here ...
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user