summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-03-02 20:25:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-03-02 20:25:12 +0800
commit1e765820a9d16dd00325c9e591726b44d61d0616 (patch)
treec7892b890b47c8193d94e2ff729f1482c4d214b7 /script/provider
parentf1191d7c6ac14778faa540d1ab15115298c8b686 (diff)
downloadlua-language-server-1e765820a9d16dd00325c9e591726b44d61d0616.zip
disable for now
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/capability.lua2
-rw-r--r--script/provider/provider.lua36
2 files changed, 37 insertions, 1 deletions
diff --git a/script/provider/capability.lua b/script/provider/capability.lua
index a87dea20..a6195ebb 100644
--- a/script/provider/capability.lua
+++ b/script/provider/capability.lua
@@ -78,7 +78,7 @@ function m.getIniter()
executeCommandProvider = {
commands = {
'lua.removeSpace:' .. sp:get_id(),
- 'lua.solve:' .. sp:get_id(),
+ 'lua.solve:' .. sp:get_id(),
},
},
foldingRangeProvider = true,
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 12ddafa1..ddab6635 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -786,6 +786,42 @@ proto.on('$/didChangeVisibleRanges', function (params)
files.setVisibles(params.uri, params.ranges)
end)
+proto.on('$/status/click', function ()
+ do return end
+ local titleDiagnostic = '进行工作区诊断'
+ local titleRestart = '重启语言服务'
+ local result = proto.awaitRequest('window/showMessageRequest', {
+ type = define.MessageType.Info,
+ message = '点击',
+ actions = {
+ {
+ title = titleDiagnostic,
+ },
+ {
+ title = titleRestart,
+ },
+ },
+ })
+ if not result then
+ return
+ end
+ if result.title == titleDiagnostic then
+ local diagnostic = require 'provider.diagnostic'
+ diagnostic.diagnosticsAll()
+ proto.notify('window/showMessage', {
+ type = define.MessageType.Info,
+ message = '诊断完成',
+ })
+ end
+ if result.title == titleRestart then
+ proto.notify('$/command', {
+ command = 'extension.lua.doc',
+ data = 'en-us/51/manual.html',
+ })
+ --os.exit(true)
+ end
+end)
+
-- Hint
do
local function updateHint(uri)