aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_lsp.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:15:05 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:27:38 +0000
commitc5d770d311841ea5230426cc4c868e8db27300a8 (patch)
treedd21f70127b4b8b5f109baefc8ecc5016f507c91 /scripts/gen_lsp.lua
parent9be89f131f87608f224f0ee06d199fcd09d32176 (diff)
parent081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff)
downloadrneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'scripts/gen_lsp.lua')
-rw-r--r--scripts/gen_lsp.lua43
1 files changed, 35 insertions, 8 deletions
diff --git a/scripts/gen_lsp.lua b/scripts/gen_lsp.lua
index c8dcf8c018..8afbae239a 100644
--- a/scripts/gen_lsp.lua
+++ b/scripts/gen_lsp.lua
@@ -58,14 +58,6 @@ end
---@param protocol vim._gen_lsp.Protocol
local function gen_methods(protocol)
- local output = {
- '-- Generated by gen_lsp.lua, keep at end of file.',
- '---',
- '---@enum vim.lsp.protocol.Methods',
- '---@see https://microsoft.github.io/language-server-protocol/specification/#metaModel',
- '--- LSP method names.',
- 'protocol.Methods = {',
- }
local indent = (' '):rep(2)
--- @class vim._gen_lsp.Request
@@ -98,6 +90,41 @@ local function gen_methods(protocol)
table.sort(all, function(a, b)
return to_luaname(a.method) < to_luaname(b.method)
end)
+
+ local output = {
+ '-- Generated by gen_lsp.lua, keep at end of file.',
+ '--- @alias vim.lsp.protocol.Method.ClientToServer',
+ }
+ for _, item in ipairs(all) do
+ if item.method and item.messageDirection == 'clientToServer' then
+ output[#output + 1] = ("--- | '%s',"):format(item.method)
+ end
+ end
+
+ vim.list_extend(output, {
+ '',
+ '--- @alias vim.lsp.protocol.Method.ServerToClient',
+ })
+ for _, item in ipairs(all) do
+ if item.method and item.messageDirection == 'serverToClient' then
+ output[#output + 1] = ("--- | '%s',"):format(item.method)
+ end
+ end
+
+ vim.list_extend(output, {
+ '',
+ '--- @alias vim.lsp.protocol.Method',
+ '--- | vim.lsp.protocol.Method.ClientToServer',
+ '--- | vim.lsp.protocol.Method.ServerToClient',
+ '',
+ '-- Generated by gen_lsp.lua, keep at end of file.',
+ '---',
+ '--- @enum vim.lsp.protocol.Methods',
+ '--- @see https://microsoft.github.io/language-server-protocol/specification/#metaModel',
+ '--- LSP method names.',
+ 'protocol.Methods = {',
+ })
+
for _, item in ipairs(all) do
if item.method then
if item.documentation then