forked from kosorin/awesome-rice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelop.lua
38 lines (34 loc) · 877 Bytes
/
develop.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
DEBUG = (os.getenv("DEBUG") or "") ~= ""
if DEBUG and os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
require("lldebugger").start()
end
local dump
if DEBUG then
local gdebug = require("gears.debug")
---@type fun(data: any, tag?: string, depth?: integer)
dump = gdebug.dump
else
local gdebug = require("gears.debug")
local notification = require("naughty.notification")
---@param data any
---@param tag? string
---@param depth? integer
function dump(data, tag, depth)
notification {
title = "DUMP",
text = gdebug.dump_return(data, tag, depth),
timeout = 0,
}
end
end
Dump = dump
---@param c client
function DumpClient(c)
Dump({
name = c.name,
class = c.class,
instance = c.instance,
role = c.role,
type = c.type,
}, "", 1)
end