From bc1d13bb368298988e87983307e6d92f20441f56 Mon Sep 17 00:00:00 2001 From: ii14 Date: Sun, 28 Nov 2021 12:33:44 +0100 Subject: chore: fix typos Co-authored-by: ii14 --- runtime/doc/eval.txt | 6 +++--- runtime/doc/lua.txt | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 46f4faefea..4d4e011c08 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3584,7 +3584,7 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()* Can also be used as a |method|: > mylist->count(val) - +< *cscope_connection()* cscope_connection([{num} , {dbpath} [, {prepend}]]) Checks for the existence of a |cscope| connection. If no @@ -3937,7 +3937,7 @@ exepath({expr}) *exepath()* Can also be used as a |method|: > GetCommand()->exepath() - +< *exists()* exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined, zero otherwise. @@ -4483,7 +4483,7 @@ foldlevel({lnum}) *foldlevel()* Can also be used as a |method|: > GetLnum()->foldlevel() - +< *foldtext()* foldtext() Returns a String, to be displayed for a closed fold. This is the default function used for the 'foldtext' option and should diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index babe27083a..70f0faf11c 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1235,7 +1235,7 @@ on_key({fn}, {ns_id}) *vim.on_key()* it removes the callback for the associated {ns_id} {ns_id} number? Namespace ID. If nil or 0, generates and - returns a new |nvim_create_namesapce()| id. + returns a new |nvim_create_namespace()| id. Return: ~ number Namespace id associated with {fn}. Or count of all @@ -1613,14 +1613,12 @@ validate({opt}) *vim.validate()* vim.validate{arg1={{'foo'}, 'table'}, arg2={'foo', 'string'}} => NOP (success) -< -> - vim.validate{arg1={1, 'table'}} - => error('arg1: expected table, got number') -< -> - vim.validate{arg1={3, function(a) return (a % 2) == 0 end, 'even number'}} - => error('arg1: expected even number, got 3') + + vim.validate{arg1={1, 'table'}} + => error('arg1: expected table, got number') + + vim.validate{arg1={3, function(a) return (a % 2) == 0 end, 'even number'}} + => error('arg1: expected even number, got 3') < Parameters: ~ -- cgit From b6e531c1d90da143d4351442baee8fef0479a6f7 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Mon, 29 Nov 2021 20:31:19 -0700 Subject: docs(lsp): add annotations for private functions --- runtime/doc/lsp.txt | 54 +++++++++++++++++------------------------------------ runtime/doc/lua.txt | 6 ------ 2 files changed, 17 insertions(+), 43 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 6482309b8a..c829fac566 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -575,9 +575,6 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms}) error, returns `(nil, err)` where `err` is a string describing the failure reason. -check_clients_closed() *vim.lsp.check_clients_closed()* - TODO: Documentation - client() *vim.lsp.client* LSP client object. You can get an active client object via |vim.lsp.get_client_by_id()| or @@ -650,12 +647,21 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()* Return: ~ true if client is stopped, false otherwise. -flush({client}) *vim.lsp.flush()* - TODO: Documentation - *vim.lsp.for_each_buffer_client()* for_each_buffer_client({bufnr}, {fn}) - TODO: Documentation + Invokes a function for each LSP client attached to a buffer. + + Parameters: ~ + {bufnr} number Buffer number + {fn} function Function to run on each client attached + to buffer {bufnr}. The function takes the client, + client ID, and buffer number as arguments. + Example: > + + vim.lsp.for_each_buffer_client(0, function(client, client_id, bufnr) + print(vim.inspect(client)) + end) +< formatexpr({opts}) *vim.lsp.formatexpr()* Provides an interface between the built-in client and a @@ -721,16 +727,6 @@ omnifunc({findstart}, {base}) *vim.lsp.omnifunc()* |complete-items| |CompleteDone| - *vim.lsp.prepare()* -prepare({bufnr}, {firstline}, {lastline}, {new_lastline}) - TODO: Documentation - -reset({client_id}) *vim.lsp.reset()* - TODO: Documentation - -reset_buf({client}, {bufnr}) *vim.lsp.reset_buf()* - TODO: Documentation - set_log_level({level}) *vim.lsp.set_log_level()* Sets the global log level for LSP logging. @@ -1097,9 +1093,6 @@ outgoing_calls() *vim.lsp.buf.outgoing_calls()* cursor in the |quickfix| window. If the symbol can resolve to multiple items, the user can pick one in the |inputlist|. -prepare_rename({err}, {result}) *vim.lsp.buf.prepare_rename()* - TODO: Documentation - *vim.lsp.buf.range_code_action()* range_code_action({context}, {start_pos}, {end_pos}) Performs |vim.lsp.buf.code_action()| for a given range. @@ -1370,9 +1363,6 @@ buf_highlight_references({bufnr}, {references}, {offset_encoding}) See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight -buf_lines() *vim.lsp.util.buf_lines()* - TODO: Documentation - *vim.lsp.util.character_offset()* character_offset({bufnr}, {row}, {col}) Returns the UTF-32 and UTF-16 offsets for a position in a @@ -1439,12 +1429,6 @@ convert_signature_help_to_markdown_lines({signature_help}, {ft}, {triggers}) See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_signatureHelp -create_file({change}) *vim.lsp.util.create_file()* - TODO: Documentation - -delete_file({change}) *vim.lsp.util.delete_file()* - TODO: Documentation - *vim.lsp.util.extract_completion_items()* extract_completion_items({result}) Can be used to extract the completion items from a `textDocument/completion` request, which may return one of `CompletionItem[]` , `CompletionList` or null. @@ -1472,9 +1456,6 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()* See also: ~ |softtabstop| -get_progress_messages() *vim.lsp.util.get_progress_messages()* - TODO: Documentation - jump_to_location({location}) *vim.lsp.util.jump_to_location()* Jumps to a location. @@ -1771,7 +1752,10 @@ get_filename() *vim.lsp.log.get_filename()* (string) log filename get_level() *vim.lsp.log.get_level()* - TODO: Documentation + Gets the current log level. + + Return: ~ + string current log level set_format_func({handle}) *vim.lsp.log.set_format_func()* Sets formatting function used to format logs @@ -1910,10 +1894,6 @@ compute_diff({prev_lines}, {curr_lines}, {firstline}, {lastline}, Return: ~ table TextDocumentContentChangeEvent see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocumentContentChangeEvent - *vim.lsp.sync.compute_line_length()* -compute_line_length({line}, {offset_encoding}) - TODO: Documentation - ============================================================================== Lua module: vim.lsp.protocol *lsp-protocol* diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 70f0faf11c..630df16e79 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1190,9 +1190,6 @@ defer_fn({fn}, {timeout}) *vim.defer_fn()* Return: ~ timer luv timer object -insert_keys({obj}) *vim.insert_keys()* - TODO: Documentation - inspect({object}, {options}) *vim.inspect()* Return a human-readable representation of the given object. @@ -1365,9 +1362,6 @@ is_callable({f}) *vim.is_callable()* Return: ~ true if `f` is callable, else false -is_valid({opt}) *vim.is_valid()* - TODO: Documentation - list_extend({dst}, {src}, {start}, {finish}) *vim.list_extend()* Extends a list-like table with the values of another list-like table. -- cgit From 5a24c2c83d76432e38f40d31db4c0a8fdd4232cf Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Mon, 29 Nov 2021 22:11:33 -0700 Subject: docs(lsp): do not use | as argument separator This translates into a tag in the help doc. --- runtime/doc/lsp.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index c829fac566..a9669e9e01 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1347,18 +1347,18 @@ buf_clear_references({bufnr}) *vim.lsp.util.buf_clear_references()* Removes document highlights from a buffer. Parameters: ~ - {bufnr} buffer id + {bufnr} number Buffer id *vim.lsp.util.buf_highlight_references()* buf_highlight_references({bufnr}, {references}, {offset_encoding}) Shows a list of document highlights for a certain buffer. Parameters: ~ - {bufnr} buffer id - {references} List of `DocumentHighlight` objects to - highlight - {offset_encoding} string utf-8|utf-16|utf-32|nil defaults - to utf-16 + {bufnr} number Buffer id + {references} table List of `DocumentHighlight` + objects to highlight + {offset_encoding} string One of "utf-8", "utf-16", + "utf-32", or nil. Defaults to utf-16 See also: ~ https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight -- cgit From d0fbbea62ae35928efcabb224932bb990d7cab29 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Mon, 29 Nov 2021 22:13:31 -0700 Subject: docs(lsp): do not use nvim_command for Vimscript examples The examples are relevant and applicable for both Lua and Vimscript configurations and the `vim.api.nvim_command` prefixes just add noise that doesn't contribute to the example. --- runtime/doc/lsp.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index a9669e9e01..e71b869413 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -991,9 +991,9 @@ document_highlight() *vim.lsp.buf.document_highlight()* triggered by a key mapping or by events such as `CursorHold` , eg: > - vim.api.nvim_command [[autocmd CursorHold lua vim.lsp.buf.document_highlight()]] - vim.api.nvim_command [[autocmd CursorHoldI lua vim.lsp.buf.document_highlight()]] - vim.api.nvim_command [[autocmd CursorMoved lua vim.lsp.buf.clear_references()]] + autocmd CursorHold lua vim.lsp.buf.document_highlight() + autocmd CursorHoldI lua vim.lsp.buf.document_highlight() + autocmd CursorMoved lua vim.lsp.buf.clear_references() < Note: Usage of |vim.lsp.buf.document_highlight()| requires the @@ -1061,7 +1061,7 @@ formatting_sync({options}, {timeout_ms}) |vim.lsp.buf_request_sync()|. Example: > - vim.api.nvim_command[[autocmd BufWritePre lua vim.lsp.buf.formatting_sync()]] + autocmd BufWritePre lua vim.lsp.buf.formatting_sync() < Parameters: ~ -- cgit