Skip to content
Snippets Groups Projects
Commit a51d5f62 authored by 最萌小汐's avatar 最萌小汐
Browse files

check Lua runtime version

parent f0f26c65
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,4 @@ xpcall(dofile, log.debug, rootPath .. '/debugger.lua')
local service = require 'service'
-- TODO
--ALL_DEEP = true
service.start()
......@@ -145,12 +145,23 @@ function m.startTimer()
end
end
function m.testVersion()
local stack = debug.setcstacklimit(201)
if debug.setcstacklimit(stack) == 201 then
proto.notify('window/showMessage', {
type = 2,
message = 'It seems to be running in Lua 5.4.0 or Lua 5.4.1 . Please upgrade to Lua 5.4.2 or above. Otherwise, it may encounter weird "C stack overflow", resulting in failure to work properly',
})
end
end
function m.start()
util.enableCloseFunction()
await.setErrorHandle(log.error)
pub.recruitBraves(4)
proto.listen()
m.report()
m.testVersion()
require 'provider'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment