mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 19:39:53 +10:00
fix(lsp): replace string types with LSP method alias type annotations where appropriate. (#36180)
fix(lsp): replace `string` types with LSP method alias where appropriate
This commit is contained in:
@@ -1087,7 +1087,7 @@ end
|
||||
--- @field name? string
|
||||
---
|
||||
--- Only return clients supporting the given method
|
||||
--- @field method? string
|
||||
--- @field method? vim.lsp.protocol.Method.ClientToServer
|
||||
---
|
||||
--- Also return uninitialized clients.
|
||||
--- @field package _uninitialized? boolean
|
||||
|
||||
@@ -649,7 +649,7 @@ end
|
||||
--- Returns the handler associated with an LSP method.
|
||||
--- Returns the default handler if the user hasn't set a custom one.
|
||||
---
|
||||
--- @param method (string) LSP method name
|
||||
--- @param method (vim.lsp.protocol.Method) LSP method name
|
||||
--- @return lsp.Handler? handler for the given method, if defined, or the default from |vim.lsp.handlers|
|
||||
function Client:_resolve_handler(method)
|
||||
return self.handlers[method] or lsp.handlers[method]
|
||||
@@ -659,7 +659,7 @@ end
|
||||
--- @param id integer
|
||||
--- @param req_type 'pending'|'complete'|'cancel'
|
||||
--- @param bufnr? integer (only required for req_type='pending')
|
||||
--- @param method? string (only required for req_type='pending')
|
||||
--- @param method? vim.lsp.protocol.Method (only required for req_type='pending')
|
||||
function Client:_process_request(id, req_type, bufnr, method)
|
||||
local pending = req_type == 'pending'
|
||||
|
||||
|
||||
@@ -106,8 +106,8 @@ end
|
||||
--- Dispatchers for LSP message types.
|
||||
--- @class vim.lsp.rpc.Dispatchers
|
||||
--- @inlinedoc
|
||||
--- @field notification fun(method: string, params: table)
|
||||
--- @field server_request fun(method: string, params: table): any?, lsp.ResponseError?
|
||||
--- @field notification fun(method: vim.lsp.protocol.Method.ClientToServer.Notification, params: table)
|
||||
--- @field server_request fun(method: vim.lsp.protocol.Method.ClientToServer.Request, params: table): any?, lsp.ResponseError?
|
||||
--- @field on_exit fun(code: integer, signal: integer)
|
||||
--- @field on_error fun(code: integer, err: any)
|
||||
|
||||
@@ -460,10 +460,10 @@ end
|
||||
--- @class vim.lsp.rpc.PublicClient
|
||||
---
|
||||
--- See [vim.lsp.rpc.request()]
|
||||
--- @field request fun(method: string, params: table?, callback: fun(err?: lsp.ResponseError, result: any), notify_reply_callback?: fun(message_id: integer)):boolean,integer?
|
||||
--- @field request fun(method: vim.lsp.protocol.Method.ClientToServer.Request, params: table?, callback: fun(err?: lsp.ResponseError, result: any), notify_reply_callback?: fun(message_id: integer)):boolean,integer?
|
||||
---
|
||||
--- See [vim.lsp.rpc.notify()]
|
||||
--- @field notify fun(method: string, params: any): boolean
|
||||
--- @field notify fun(method: vim.lsp.protocol.Method.ClientToServer.Notification, params: any): boolean
|
||||
---
|
||||
--- Indicates if the RPC is closing.
|
||||
--- @field is_closing fun(): boolean
|
||||
|
||||
Reference in New Issue
Block a user