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/lua/vim/lsp/util.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/lsp/util.lua') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 2879c4a565..e9155a7231 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -158,6 +158,7 @@ end local function get_lines(bufnr, rows) rows = type(rows) == "table" and rows or { rows } + ---@private local function buf_lines() local lines = {} for _, row in pairs(rows) do @@ -262,6 +263,7 @@ local function get_line_byte_from_position(bufnr, position, offset_encoding) end --- Process and return progress reports from lsp server +---@private function M.get_progress_messages() local new_messages = {} @@ -657,7 +659,7 @@ function M.rename(old_fname, new_fname, opts) api.nvim_buf_delete(oldbuf, { force = true }) end - +---@private local function create_file(change) local opts = change.options or {} -- from spec: Overwrite wins over `ignoreIfExists` @@ -669,7 +671,7 @@ local function create_file(change) vim.fn.bufadd(fname) end - +---@private local function delete_file(change) local opts = change.options or {} local fname = vim.uri_to_fname(change.uri) -- 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/lua/vim/lsp/util.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/lsp/util.lua') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index e9155a7231..950611a074 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1416,7 +1416,7 @@ do --[[ References ]] --- Removes document highlights from a buffer. --- - ---@param bufnr buffer id + ---@param bufnr number Buffer id function M.buf_clear_references(bufnr) validate { bufnr = {bufnr, 'n', true} } api.nvim_buf_clear_namespace(bufnr, reference_ns, 0, -1) @@ -1424,9 +1424,9 @@ do --[[ References ]] --- Shows a list of document highlights for a certain buffer. --- - ---@param bufnr buffer id - ---@param references List of `DocumentHighlight` objects to highlight - ---@param offset_encoding string utf-8|utf-16|utf-32|nil defaults to utf-16 + ---@param bufnr number Buffer id + ---@param references table List of `DocumentHighlight` objects to highlight + ---@param offset_encoding string One of "utf-8", "utf-16", "utf-32", or nil. Defaults to utf-16 ---@see https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#documentHighlight function M.buf_highlight_references(bufnr, references, offset_encoding) validate { bufnr = {bufnr, 'n', true} } -- cgit