mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
feat(lsp): document method types (#35934)
This commit is contained in:
@@ -669,6 +669,7 @@ function protocol.resolve_capabilities(server_capabilities)
|
||||
end
|
||||
|
||||
-- Generated by gen_lsp.lua, keep at end of file.
|
||||
--- LSP Request (direction: clientToServer)
|
||||
--- @alias vim.lsp.protocol.Method.ClientToServer.Request
|
||||
--- | 'callHierarchy/incomingCalls',
|
||||
--- | 'callHierarchy/outgoingCalls',
|
||||
@@ -725,6 +726,7 @@ end
|
||||
--- | 'workspace/willDeleteFiles',
|
||||
--- | 'workspace/willRenameFiles',
|
||||
|
||||
--- LSP Notification (direction: clientToServer)
|
||||
--- @alias vim.lsp.protocol.Method.ClientToServer.Notification
|
||||
--- | '$/setTrace',
|
||||
--- | 'exit',
|
||||
@@ -746,10 +748,12 @@ end
|
||||
--- | 'workspace/didDeleteFiles',
|
||||
--- | 'workspace/didRenameFiles',
|
||||
|
||||
--- LSP Message (direction: clientToServer).
|
||||
--- @alias vim.lsp.protocol.Method.ClientToServer
|
||||
--- | vim.lsp.protocol.Method.ClientToServer.Request
|
||||
--- | vim.lsp.protocol.Method.ClientToServer.Notification
|
||||
|
||||
--- LSP Request (direction: serverToClient)
|
||||
--- @alias vim.lsp.protocol.Method.ServerToClient.Request
|
||||
--- | 'client/registerCapability',
|
||||
--- | 'client/unregisterCapability',
|
||||
@@ -767,6 +771,7 @@ end
|
||||
--- | 'workspace/textDocumentContent/refresh',
|
||||
--- | 'workspace/workspaceFolders',
|
||||
|
||||
--- LSP Notification (direction: serverToClient)
|
||||
--- @alias vim.lsp.protocol.Method.ServerToClient.Notification
|
||||
--- | '$/logTrace',
|
||||
--- | 'telemetry/event',
|
||||
@@ -774,6 +779,7 @@ end
|
||||
--- | 'window/logMessage',
|
||||
--- | 'window/showMessage',
|
||||
|
||||
--- LSP Message (direction: serverToClient).
|
||||
--- @alias vim.lsp.protocol.Method.ServerToClient
|
||||
--- | vim.lsp.protocol.Method.ServerToClient.Request
|
||||
--- | vim.lsp.protocol.Method.ServerToClient.Notification
|
||||
|
@@ -154,6 +154,7 @@ local function write_to_vim_protocol(protocol)
|
||||
{ title = 'Request', methods = protocol.requests },
|
||||
{ title = 'Notification', methods = protocol.notifications },
|
||||
}) do
|
||||
output[#output + 1] = ('--- LSP %s (direction: %s)'):format(b.title, dir)
|
||||
output[#output + 1] = ('--- @alias %s.%s'):format(alias, b.title)
|
||||
for _, item in ipairs(b.methods) do
|
||||
if item.messageDirection == dir then
|
||||
@@ -164,6 +165,7 @@ local function write_to_vim_protocol(protocol)
|
||||
end
|
||||
|
||||
vim.list_extend(output, {
|
||||
('--- LSP Message (direction: %s).'):format(dir),
|
||||
('--- @alias %s'):format(alias),
|
||||
('--- | %s.Request'):format(alias),
|
||||
('--- | %s.Notification'):format(alias),
|
||||
|
@@ -465,7 +465,6 @@ end
|
||||
--- @param generics? table<string,string>
|
||||
--- @param default? string
|
||||
local function render_type(ty, generics, default)
|
||||
-- TODO(lewis6991): Document LSP protocol types
|
||||
ty = ty:gsub('vim%.lsp%.protocol%.Method.[%w.]+', 'string')
|
||||
|
||||
if generics then
|
||||
|
Reference in New Issue
Block a user