docs(lsp): annotate with vim.lsp.protocol.Methods enum #29521

Added the enum type annotation `vim.lsp.protocol.Methods` to provide some intellisense support.
This commit is contained in:
Ricardo Casía 2024-08-20 14:52:14 +02:00 committed by GitHub
parent ac53996ebb
commit 766d503627
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 910 additions and 658 deletions

File diff suppressed because it is too large Load Diff

View File

@ -615,9 +615,10 @@ function protocol.resolve_capabilities(server_capabilities)
end
-- Generated by gen_lsp.lua, keep at end of file.
--- LSP method names.
---
---@enum vim.lsp.protocol.Methods
---@see https://microsoft.github.io/language-server-protocol/specification/#metaModel
--- LSP method names.
protocol.Methods = {
--- A request to resolve the incoming calls for a given `CallHierarchyItem`.
--- @since 3.16.0
@ -880,14 +881,14 @@ protocol.Methods = {
--- symbol's location.
--- @since 3.17.0
workspaceSymbol_resolve = 'workspaceSymbol/resolve',
--- A request sent from the server to the client to modify certain resources.
--- A request sent from the server to the client to modified certain resources.
workspace_applyEdit = 'workspace/applyEdit',
--- A request to refresh all code actions
--- @since 3.16.0
workspace_codeLens_refresh = 'workspace/codeLens/refresh',
--- The 'workspace/configuration' request is sent from the server to the client to fetch a certain
--- configuration setting.
--- This pull model replaces the old push model where the client signaled configuration change via an
--- This pull model replaces the old push model were the client signaled configuration change via an
--- event. If the server still needs to react to configuration changes (since the server caches the
--- result of `workspace/configuration` requests) the server should register for an empty configuration
--- change event and empty the cache if such an event is received.
@ -920,7 +921,7 @@ protocol.Methods = {
--- files were renamed from within the client.
--- @since 3.16.0
workspace_didRenameFiles = 'workspace/didRenameFiles',
--- A request sent from the client to the server to execute a command. The request might return
--- A request send from the client to the server to execute a command. The request might return
--- a workspace edit which the client will apply to the workspace.
workspace_executeCommand = 'workspace/executeCommand',
--- @since 3.18.0

View File

@ -60,9 +60,10 @@ end
local function gen_methods(protocol)
local output = {
'-- Generated by gen_lsp.lua, keep at end of file.',
'--- LSP method names.',
'---',
'---@enum vim.lsp.protocol.Methods',
'---@see https://microsoft.github.io/language-server-protocol/specification/#metaModel',
'--- LSP method names.',
'protocol.Methods = {',
}
local indent = (' '):rep(2)