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