summaryrefslogtreecommitdiff
path: root/script/provider/provider.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-01-27 19:52:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-01-27 19:52:23 +0800
commit2d63a946faebbda3fc7f4a1e87d8e8453fc727eb (patch)
treedbb0bb425fe72704043c9504660d15f4dbe59c43 /script/provider/provider.lua
parent43a29d8842d5533750c8cfc5198f5df603fa8ca5 (diff)
downloadlua-language-server-2d63a946faebbda3fc7f4a1e87d8e8453fc727eb.zip
add some progress
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r--script/provider/provider.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 4df42610..e65fb440 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -16,6 +16,7 @@ local pub = require 'pub'
local fs = require 'bee.filesystem'
local lang = require 'language'
local plugin = require 'plugin'
+local progress = require 'progress'
local function updateConfig()
local diagnostics = require 'provider.diagnostic'
@@ -97,6 +98,7 @@ proto.on('initialize', function (params)
end)
proto.on('initialized', function (params)
+ local _ <close> = progress.create('正在初始化...', 1)
updateConfig()
proto.awaitRequest('client/registerCapability', {
registrations = {
@@ -216,6 +218,7 @@ end)
proto.on('textDocument/hover', function (params)
await.close 'hover'
await.setID 'hover'
+ local _ <close> = progress.create('正在处理悬浮提示...', 1)
workspace.awaitReady()
local core = require 'core.hover'
local doc = params.textDocument
@@ -245,6 +248,7 @@ proto.on('textDocument/hover', function (params)
end)
proto.on('textDocument/definition', function (params)
+ local _ <close> = progress.create('正在处理转到定义...', 1)
workspace.awaitReady()
local core = require 'core.definition'
local uri = params.textDocument.uri
@@ -273,6 +277,7 @@ proto.on('textDocument/definition', function (params)
end)
proto.on('textDocument/references', function (params)
+ local _ <close> = progress.create('正在处理转到引用...', 1)
workspace.awaitReady()
local core = require 'core.reference'
local uri = params.textDocument.uri
@@ -316,6 +321,7 @@ proto.on('textDocument/documentHighlight', function (params)
end)
proto.on('textDocument/rename', function (params)
+ local _ <close> = progress.create('正在处理重命名...', 1)
workspace.awaitReady()
local core = require 'core.rename'
local uri = params.textDocument.uri
@@ -359,6 +365,7 @@ proto.on('textDocument/prepareRename', function (params)
end)
proto.on('textDocument/completion', function (params)
+ local _ <close> = progress.create('正在处理自动完成...', 1)
workspace.awaitReady()
--log.info(util.dump(params))
local core = require 'core.completion'
@@ -483,6 +490,7 @@ proto.on('textDocument/signatureHelp', function (params)
if not config.config.signatureHelp.enable then
return nil
end
+ local _ <close> = progress.create('正在处理参数提示...', 1)
workspace.awaitReady()
local uri = params.textDocument.uri
if not files.exists(uri) then
@@ -523,6 +531,7 @@ proto.on('textDocument/signatureHelp', function (params)
end)
proto.on('textDocument/documentSymbol', function (params)
+ local _ <close> = progress.create('正在处理文件符号...', 1)
local core = require 'core.document-symbol'
local uri = params.textDocument.uri
while not files.exists(uri) do
@@ -607,6 +616,7 @@ proto.on('workspace/executeCommand', function (params)
end)
proto.on('workspace/symbol', function (params)
+ local _ <close> = progress.create('正在处理工作区符号...', 1)
workspace.awaitReady()
local core = require 'core.workspace-symbol'
@@ -639,6 +649,7 @@ end)
proto.on('textDocument/semanticTokens/full', function (params)
+ local _ <close> = progress.create('正在处理全量语义着色...', 1)
workspace.awaitReady()
local core = require 'core.semantic-tokens'
local uri = params.textDocument.uri
@@ -655,6 +666,7 @@ proto.on('textDocument/semanticTokens/full', function (params)
end)
proto.on('textDocument/semanticTokens/range', function (params)
+ local _ <close> = progress.create('正在处理差量语义着色...', 1)
workspace.awaitReady()
local core = require 'core.semantic-tokens'
local uri = params.textDocument.uri