summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-13 18:39:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-13 18:39:45 +0800
commitffb9d5437ad78dbd392f72fd60b4c03f4cefb970 (patch)
tree0d6a34b39dcd93250b0d588226ab95954cdcd94c /script
parent402eb5fbf775a7ee7a7e16cc506e06d8f299274b (diff)
downloadlua-language-server-ffb9d5437ad78dbd392f72fd60b4c03f4cefb970.zip
add progress for building
Diffstat (limited to 'script')
-rw-r--r--script/provider/build-meta.lua15
-rw-r--r--script/provider/provider.lua2
2 files changed, 12 insertions, 5 deletions
diff --git a/script/provider/build-meta.lua b/script/provider/build-meta.lua
index a1900e5e..21390411 100644
--- a/script/provider/build-meta.lua
+++ b/script/provider/build-meta.lua
@@ -1,7 +1,9 @@
-local fs = require 'bee.filesystem'
-local config = require 'config'
-local util = require 'utility'
-local await = require 'await'
+local fs = require 'bee.filesystem'
+local config = require 'config'
+local util = require 'utility'
+local await = require 'await'
+local progress = require 'progress'
+local lang = require 'language'
local m = {}
@@ -136,8 +138,11 @@ function m.build(name, api)
files[api.root][#files[api.root]+1] = buildRootText(api)
- for _, class in ipairs(api.classes) do
+ local proc <close> = progress.create(nil, lang.script.WINDOW_PROCESSING_BUILD_META, 0.5)
+ for i, class in ipairs(api.classes) do
local space = class.namespace ~= '' and class.namespace or api.root
+ proc:setMessage(space)
+ proc:setPercentage(i / #api.classes * 100)
local text = buildText(api.root, class)
files[space][#files[space]+1] = text
await.delay()
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 26c0a777..a5255f44 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -1342,6 +1342,8 @@ m.register '$/api/report' {
---@async
function (params)
local buildMeta = require 'provider.build-meta'
+ await.close 'api/report'
+ await.setID 'api/report'
local dir = buildMeta.build('default', params)
client.setConfig {
{