diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-28 17:40:11 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-28 17:40:11 +0800 |
commit | 9de4be8cfdc13cca9d672b708fa4699116a9a82a (patch) | |
tree | e9f41b4466792d889e5ae3893bf00f919cb91419 /script/progress.lua | |
parent | 6bc61fd0667b0f05ed225fe0f108e7ce96279291 (diff) | |
download | lua-language-server-9de4be8cfdc13cca9d672b708fa4699116a9a82a.zip |
config of progress
Diffstat (limited to 'script/progress.lua')
-rw-r--r-- | script/progress.lua | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/script/progress.lua b/script/progress.lua index 2e01daa2..19f759ee 100644 --- a/script/progress.lua +++ b/script/progress.lua @@ -1,6 +1,7 @@ -local proto = require 'proto.proto' -local util = require 'utility' -local timer = require "timer" +local proto = require 'proto.proto' +local util = require 'utility' +local timer = require "timer" +local config = require 'config' local nextToken = util.counter() @@ -80,8 +81,11 @@ function mt:_update() end if not self._showed and self._clock + self._delay <= os.clock() then - self._showed = true self._updated = os.clock() + self._dirty = false + if not config.config.window.progressBar then + return + end proto.request('window/workDoneProgress/create', { token = self._token, }) @@ -95,13 +99,17 @@ function mt:_update() percentage = self._percentage, } }) + self._showed = true log.info('Create progress:', self._token, self._title) - self._dirty = false return end if not self._showed then return end + if not config.config.window.progressBar then + self:remove() + return + end if os.clock() - self._updated < 0.05 then return end |