summaryrefslogtreecommitdiff
path: root/server/src/method/workspace/didChangeWorkspaceFolders.lua
blob: 01a28abd98a436551bfeba22df45cc81693e5777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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