summaryrefslogtreecommitdiff
path: root/script/provider/semantic-tokens.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-23 21:47:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-23 21:47:21 +0800
commit5dae895f67bf0f75278d25b0d412e00705386fce (patch)
treef4d08c51d96a706f2ad00ac5caec27a9006e5b0e /script/provider/semantic-tokens.lua
parent5e3ec5527377acf9e6ab60fe222c40ddf2ef591c (diff)
downloadlua-language-server-5dae895f67bf0f75278d25b0d412e00705386fce.zip
fix some dialog boxes block the initialization
Diffstat (limited to 'script/provider/semantic-tokens.lua')
-rw-r--r--script/provider/semantic-tokens.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/script/provider/semantic-tokens.lua b/script/provider/semantic-tokens.lua
index 268b8648..bee31eaa 100644
--- a/script/provider/semantic-tokens.lua
+++ b/script/provider/semantic-tokens.lua
@@ -31,7 +31,7 @@ local function enable()
nonil.disable()
isEnable = true
log.debug('Enable semantic tokens.')
- proto.awaitRequest('client/registerCapability', {
+ proto.request('client/registerCapability', {
registrations = {
{
id = 'semantic-tokens',
@@ -48,7 +48,7 @@ local function enable()
}
})
if config.other.semantic == 'configuredByTheme' and not dontShowAgain then
- local item = proto.awaitRequest('window/showMessageRequest', {
+ proto.request('window/showMessageRequest', {
type = define.MessageType.Info,
message = lang.script.WINDOW_CHECK_SEMANTIC,
actions = {
@@ -59,8 +59,10 @@ local function enable()
title = lang.script.WINDOW_DONT_SHOW_AGAIN,
},
}
- })
- if item then
+ }, function (item)
+ if not item then
+ return
+ end
if item.title == lang.script.WINDOW_APPLY_SETTING then
proto.notify('$/command', {
command = 'lua.config',
@@ -75,7 +77,7 @@ local function enable()
if item.title == lang.script.WINDOW_DONT_SHOW_AGAIN then
dontShowAgain = true
end
- end
+ end)
end
end
@@ -90,7 +92,7 @@ local function disable()
nonil.disable()
isEnable = false
log.debug('Disable semantic tokens.')
- proto.awaitRequest('client/unregisterCapability', {
+ proto.request('client/unregisterCapability', {
unregisterations = {
{
id = 'semantic-tokens',