feat(lsp): use stricter types for methods

This change modifies gen_lsp.lua so alias types are generated for
various types of lsp methods to distinguish between notifications
and requests:
 - vim.lsp.protocol.Method.ServerToClient.Request
 - vim.lsp.protocol.Method.ServerToClient.Notification
 - vim.lsp.protocol.Method.ClientToServer.Request
 - vim.lsp.protocol.Method.ClientToServer.Notification

 These types are then used instead of `string` where appropriate.
This commit is contained in:
Lewis Russell
2025-04-17 10:21:41 +01:00
committed by Lewis Russell
parent 34b4df774d
commit d7e0d46ffa
8 changed files with 104 additions and 104 deletions

View File

@@ -1285,7 +1285,7 @@ end
---@since 7
---
---@param bufnr integer Buffer handle, or 0 for current.
---@param method string LSP method name
---@param method vim.lsp.protocol.Method.ClientToServer.Request LSP method name
---@param params? table|(fun(client: vim.lsp.Client, bufnr: integer): table?) Parameters to send to the server.
--- Can also be passed as a function that returns the params table for cases where
--- parameters are specific to the client.