From 09e56887d9290020841553bd0ee2bf87cb8ad2d3 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Thu, 28 Nov 2024 00:38:50 +0100 Subject: [PATCH] chore: configure lldebugger for tests --- .cspell.json | 1 + .vscode/launch.json | 18 ++++++++++++++++++ spec/helper.lua | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.cspell.json b/.cspell.json index 0847b86..51a69f8 100644 --- a/.cspell.json +++ b/.cspell.json @@ -23,6 +23,7 @@ "keygrabber", "ldoc", "leafo", + "lldebugger", "luacheck", "luacheckrc", "luadoc", diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e6a2736 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Busted", + "type": "lua-local", + "request": "launch", + "program": { + "command": "luarocks" + }, + "args": ["test"] + // "ignorePatterns": "^/usr" + } + ] +} diff --git a/spec/helper.lua b/spec/helper.lua index de070a5..ebeeea5 100644 --- a/spec/helper.lua +++ b/spec/helper.lua @@ -1,3 +1,9 @@ +-- Enable lua-local-debugger +-- https://github.com/tomblind/local-lua-debugger-vscode +if os.getenv "LOCAL_LUA_DEBUGGER_VSCODE" == "1" then + require("lldebugger").start() +end + -- Fake awesome modules package.loaded["gears.table"] = { hasitem = function(t, item)