diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-13 18:39:38 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-13 18:39:45 +0800 |
commit | ffb9d5437ad78dbd392f72fd60b4c03f4cefb970 (patch) | |
tree | 0d6a34b39dcd93250b0d588226ab95954cdcd94c /script/provider/build-meta.lua | |
parent | 402eb5fbf775a7ee7a7e16cc506e06d8f299274b (diff) | |
download | lua-language-server-ffb9d5437ad78dbd392f72fd60b4c03f4cefb970.zip |
add progress for building
Diffstat (limited to 'script/provider/build-meta.lua')
-rw-r--r-- | script/provider/build-meta.lua | 15 |
1 files changed, 10 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() |