diff options
Diffstat (limited to 'script/method/workspace/didChangeWorkspaceFolders.lua')
-rw-r--r-- | script/method/workspace/didChangeWorkspaceFolders.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/script/method/workspace/didChangeWorkspaceFolders.lua b/script/method/workspace/didChangeWorkspaceFolders.lua new file mode 100644 index 00000000..01a28abd --- /dev/null +++ b/script/method/workspace/didChangeWorkspaceFolders.lua @@ -0,0 +1,20 @@ +local rpc = require 'rpc' +local lang = require 'language' + +return function () + -- 暂不支持多个工作目录,因此当工作目录切换时,暴力结束服务,让前端重启服务 + rpc:requestWait('window/showMessageRequest', { + type = 3, + message = lang.script('MWS_NOT_SUPPORT', '[Lua]'), + actions = { + { + title = lang.script.MWS_RESTART, + } + } + }, function () + os.exit(true) + end) + ac.wait(5, function () + os.exit(true) + end) +end |