summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-08-06 20:21:46 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-08-06 20:21:46 +0800
commit011f95c71a96ddb2c15a75b95d42c0fddf6f37cc (patch)
treedfc8fe8dc0671f4dfd4aaf615204c0b0b89d1752
parent16a7c65b0284d4b8ae40b2d1c75d898c08771b34 (diff)
downloadlua-language-server-011f95c71a96ddb2c15a75b95d42c0fddf6f37cc.zip
需要 statusBar 选项才会显示状态栏
-rw-r--r--script/provider/provider.lua3
-rw-r--r--script/service/service.lua4
2 files changed, 7 insertions, 0 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 3c9782c1..af01aaf8 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -1599,6 +1599,9 @@ m.register '$/psi/select' {
local function refreshStatusBar()
+ if not client.getOption('statusBar') then
+ return
+ end
local valid = config.get(nil, 'Lua.window.statusBar')
for _, scp in ipairs(workspace.folders) do
if not config.get(scp.uri, 'Lua.window.statusBar') then
diff --git a/script/service/service.lua b/script/service/service.lua
index c3afd4cf..a9a02316 100644
--- a/script/service/service.lua
+++ b/script/service/service.lua
@@ -13,6 +13,7 @@ local time = require 'bee.time'
local fw = require 'filewatch'
local furi = require 'file-uri'
local net = require 'service.net'
+local client = require 'client'
require 'jsonc'
require 'json-beautify'
@@ -202,6 +203,9 @@ end
local showStatusTip = math.random(100) == 1
function m.reportStatus()
+ if not client.getOption('statusBar') then
+ return
+ end
local info = {}
if m.workingClock and time.monotonic() - m.workingClock > 100 then
info.text = '$(loading~spin)Lua'