diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-24 17:29:40 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-24 17:29:40 +0800 |
commit | 65aac0a4e58252a91394c7d249efa78182d63f2f (patch) | |
tree | 9debd9da10eb938300074e2cec05f43fb203616c | |
parent | c34940df790c8e26ce6e37a076785e718e08f523 (diff) | |
download | lua-language-server-65aac0a4e58252a91394c7d249efa78182d63f2f.zip |
add tracy
-rw-r--r-- | .vscode/settings.json | 3 | ||||
-rw-r--r-- | main.lua | 2 | ||||
-rw-r--r-- | script/tracy.lua | 18 | ||||
-rw-r--r-- | test.lua | 1 |
4 files changed, 23 insertions, 1 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 89305242..54ad1616 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,7 +11,8 @@ "ID", "DEVELOP", "DBGPORT", - "DBGWAIT" + "DBGWAIT", + "tracy" ], "Lua.diagnostics.disable": [ "close-non-object" @@ -14,6 +14,8 @@ log.init(ROOT, ROOT / 'log' / 'service.log') log.info('Lua Lsp startup, root: ', ROOT) log.debug('ROOT:', ROOT:string()) +require 'tracy' .disable() + xpcall(dofile, log.debug, rootPath .. '/debugger.lua') local service = require 'service' diff --git a/script/tracy.lua b/script/tracy.lua new file mode 100644 index 00000000..a5f6d9b1 --- /dev/null +++ b/script/tracy.lua @@ -0,0 +1,18 @@ +local suc = pcall(require, 'luatracy') +local originTracy = tracy + +local function enable() + tracy = originTracy +end + +local function disable() + tracy = { + ZoneBeginN = function () end, + ZoneEnd = function () end, + } +end + +return { + enable = enable, + disable = disable, +} @@ -18,6 +18,7 @@ log.debug('测试开始') ac = {} --dofile((ROOT / 'build_package.lua'):string()) +require 'tracy' .enable() local function loadAllLibs() assert(require 'bee.filesystem') |