diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-07 15:01:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-07 15:01:25 +0800 |
commit | a2050f55b58e5990ebfc33ed9ae4db90c7bf3f19 (patch) | |
tree | 4e1c44a806815b2088877f3c49ed0cfa8942e0d9 /script/service | |
parent | e7b1f98a39b6761659a4187c424ce3dbbb6ff957 (diff) | |
download | lua-language-server-a2050f55b58e5990ebfc33ed9ae4db90c7bf3f19.zip |
cleanup
Diffstat (limited to 'script/service')
-rw-r--r-- | script/service/service.lua | 11 | ||||
-rw-r--r-- | script/service/telemetry.lua | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/script/service/service.lua b/script/service/service.lua index 247cb5b5..bd9c425f 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -10,6 +10,7 @@ local files = require 'files' local lang = require 'language' local ws = require 'workspace' local time = require 'bee.time' +local config = require 'config' local m = {} m.type = 'service' @@ -198,6 +199,16 @@ function m.reportStatus() proto.notify('$/status/report', info) end +config.watch(function (key, value) + if key == 'Lua.window.statusBar' then + if value then + proto.notify('$/status/show') + else + proto.notify('$/status/hide') + end + end +end) + function m.testVersion() local stack = debug.setcstacklimit(200) debug.setcstacklimit(stack + 1) diff --git a/script/service/telemetry.lua b/script/service/telemetry.lua index 7a2b2514..419589e7 100644 --- a/script/service/telemetry.lua +++ b/script/service/telemetry.lua @@ -141,4 +141,10 @@ function m.updateConfig() end) end +config.watch(function (key) + if key == 'Lua.telemetry.enable' then + m.updateConfig() + end +end) + return m |