feat(lsp): run handler in coroutine to support async response (#21026)

To illustrate a use-case this also changes `window/showMessageRequest`
to use `vim.ui.select`
This commit is contained in:
Mathias Fußenegger
2022-11-19 10:48:49 +01:00
committed by GitHub
parent 0958dccc6d
commit af204dd0f1
3 changed files with 76 additions and 49 deletions

View File

@@ -20,6 +20,14 @@ function transform_schema_to_table()
end
--]=]
---@class lsp.ShowMessageRequestParams
---@field type lsp.MessageType
---@field message string
---@field actions nil|lsp.MessageActionItem[]
---@class lsp.MessageActionItem
---@field title string
local constants = {
DiagnosticSeverity = {
-- Reports an error.
@@ -39,6 +47,7 @@ local constants = {
Deprecated = 2,
},
---@enum lsp.MessageType
MessageType = {
-- An error message.
Error = 1,