mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
docs(lua): more improvements (#24387)
* docs(lua): teach lua2dox how to table * docs(lua): teach gen_vimdoc.py about local functions No more need to mark local functions with @private * docs(lua): mention @nodoc and @meta in dev-lua-doc * fixup! Co-authored-by: Justin M. Keyes <justinkz@gmail.com> --------- Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -5,7 +5,6 @@ local npcall = vim.F.npcall
|
||||
|
||||
local M = {}
|
||||
|
||||
---@private
|
||||
--- Sends an async request to all active clients attached to the current
|
||||
--- buffer.
|
||||
---
|
||||
@@ -45,7 +44,6 @@ function M.hover()
|
||||
request('textDocument/hover', params)
|
||||
end
|
||||
|
||||
---@private
|
||||
local function request_with_options(name, params, options)
|
||||
local req_handler
|
||||
if options then
|
||||
@@ -120,7 +118,6 @@ function M.completion(context)
|
||||
return request('textDocument/completion', params)
|
||||
end
|
||||
|
||||
---@private
|
||||
---@param bufnr integer
|
||||
---@param mode "v"|"V"
|
||||
---@return table {start={row,col}, end={row,col}} using (1, 0) indexing
|
||||
@@ -218,7 +215,6 @@ function M.format(options)
|
||||
vim.notify('[LSP] Format request failed, no matching language servers.')
|
||||
end
|
||||
|
||||
---@private
|
||||
local function set_range(client, params)
|
||||
if range then
|
||||
local range_params =
|
||||
@@ -289,7 +285,6 @@ function M.rename(new_name, options)
|
||||
-- Compute early to account for cursor movements after going async
|
||||
local cword = vim.fn.expand('<cword>')
|
||||
|
||||
---@private
|
||||
local function get_text_at_range(range, offset_encoding)
|
||||
return api.nvim_buf_get_text(
|
||||
bufnr,
|
||||
@@ -307,7 +302,6 @@ function M.rename(new_name, options)
|
||||
return
|
||||
end
|
||||
|
||||
---@private
|
||||
local function rename(name)
|
||||
local params = util.make_position_params(win, client.offset_encoding)
|
||||
params.newName = name
|
||||
@@ -408,7 +402,6 @@ function M.document_symbol(options)
|
||||
request_with_options('textDocument/documentSymbol', params, options)
|
||||
end
|
||||
|
||||
---@private
|
||||
local function pick_call_hierarchy_item(call_hierarchy_items)
|
||||
if not call_hierarchy_items then
|
||||
return
|
||||
@@ -428,7 +421,6 @@ local function pick_call_hierarchy_item(call_hierarchy_items)
|
||||
return choice
|
||||
end
|
||||
|
||||
---@private
|
||||
local function call_hierarchy(method)
|
||||
local params = util.make_position_params()
|
||||
request('textDocument/prepareCallHierarchy', params, function(err, result, ctx)
|
||||
@@ -579,8 +571,6 @@ function M.clear_references()
|
||||
util.buf_clear_references()
|
||||
end
|
||||
|
||||
---@private
|
||||
--
|
||||
--- This is not public because the main extension point is
|
||||
--- vim.ui.select which can be overridden independently.
|
||||
---
|
||||
@@ -592,7 +582,6 @@ end
|
||||
local function on_code_action_results(results, ctx, options)
|
||||
local action_tuples = {}
|
||||
|
||||
---@private
|
||||
local function action_filter(a)
|
||||
-- filter by specified action kind
|
||||
if options and options.context and options.context.only then
|
||||
@@ -632,7 +621,6 @@ local function on_code_action_results(results, ctx, options)
|
||||
return
|
||||
end
|
||||
|
||||
---@private
|
||||
local function apply_action(action, client)
|
||||
if action.edit then
|
||||
util.apply_workspace_edit(action.edit, client.offset_encoding)
|
||||
@@ -643,7 +631,6 @@ local function on_code_action_results(results, ctx, options)
|
||||
end
|
||||
end
|
||||
|
||||
---@private
|
||||
local function on_user_choice(action_tuple)
|
||||
if not action_tuple then
|
||||
return
|
||||
@@ -701,7 +688,6 @@ end
|
||||
|
||||
--- Requests code actions from all clients and calls the handler exactly once
|
||||
--- with all aggregated results
|
||||
---@private
|
||||
local function code_action_request(params, options)
|
||||
local bufnr = api.nvim_get_current_buf()
|
||||
local method = 'textDocument/codeAction'
|
||||
|
||||
Reference in New Issue
Block a user