Skip to content

Commit e073cdd

Browse files
committed
style: run stylua
1 parent 13e87e3 commit e073cdd

4 files changed

Lines changed: 40 additions & 42 deletions

File tree

lua/dap-vscode-js/session.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function M.unregister_session(session)
5050
end
5151

5252
function M.is_session_registered(session)
53-
return not not sessions[session]
53+
return not not sessions[session]
5454
end
5555

5656
local function get_breakpoints(pid)

tests/integration/jest_spec.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local breakpoints = require("dap.breakpoints")
22
local async = require("plenary.async.tests")
33
local wrap = require("plenary.async.async").wrap
44
local dapjs = require("dap-vscode-js")
5-
local js_session = require"dap-vscode-js.session"
5+
local js_session = require("dap-vscode-js.session")
66
local dap = require("dap")
77
local test_utils = require("__dap_js_test_util")
88
local config = require("dap-vscode-js.config")
@@ -35,35 +35,35 @@ describe("pwa-node jest", function()
3535
async.it(
3636
"receives stdout from terminal",
3737
wrap(function(done)
38-
local terminated = false
38+
local terminated = false
3939

40-
local lines_found = {
41-
["Tests: 1 failed, 1 passed, 2 total"] = false,
42-
["Ran all test suites."] = false,
43-
["Waiting for the debugger to disconnect..."] = false,
44-
}
40+
local lines_found = {
41+
["Tests: 1 failed, 1 passed, 2 total"] = false,
42+
["Ran all test suites."] = false,
43+
["Waiting for the debugger to disconnect..."] = false,
44+
}
4545

4646
local function try_exit()
4747
if terminated and vim.tbl_count(lines_found) == 0 then
48-
done()
49-
end
48+
done()
49+
end
5050
end
5151

5252
test_utils.get_terminal_remote(function(lines)
5353
for _, line in ipairs(lines) do
54-
lines_found[line] = nil
54+
lines_found[line] = nil
5555
end
5656

5757
try_exit()
5858
end)
5959

6060
test_utils.open_test("jest/integration.test.ts")
6161

62-
test_utils.on_session_end(function ()
63-
terminated = true
62+
test_utils.on_session_end(function()
63+
terminated = true
6464

65-
try_exit()
66-
end)
65+
try_exit()
66+
end)
6767

6868
dap.run(launch_config)
6969
end, 1)

tests/integration/node_spec.lua

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ describe("pwa-node", function()
2323
end)
2424

2525
describe("typescript", function()
26-
2726
async.it(
2827
"can be debugged with simple config",
2928
wrap(function(done)
@@ -54,7 +53,7 @@ describe("pwa-node", function()
5453
try_exit()
5554
end)
5655

57-
test_utils.on_session_end(function ()
56+
test_utils.on_session_end(function()
5857
termination_happened = true
5958

6059
try_exit()
@@ -75,32 +74,31 @@ describe("pwa-node", function()
7574
test_utils.add_listener("after", "event_stopped", function(session, body)
7675
assert.equal(body.reason, "breakpoint")
7776

78-
local bps = breakpoints.get(bufexpr)[bufexpr]
77+
local bps = breakpoints.get(bufexpr)[bufexpr]
7978

80-
assert.equal(#bps, 1)
79+
assert.equal(#bps, 1)
8180

82-
local bp_signs = test_utils.get_breakpoint_signs(bufexpr)
81+
local bp_signs = test_utils.get_breakpoint_signs(bufexpr)
8382

84-
assert.equal(#bp_signs, 1)
83+
assert.equal(#bp_signs, 1)
8584

86-
for _, bp in ipairs(bp_signs) do
87-
assert.equal(#bp.signs, 1)
85+
for _, bp in ipairs(bp_signs) do
86+
assert.equal(#bp.signs, 1)
8887

89-
for _, sign in ipairs(bp.signs) do
90-
assert.equal(sign.name, "DapBreakpoint")
91-
end
92-
end
88+
for _, sign in ipairs(bp.signs) do
89+
assert.equal(sign.name, "DapBreakpoint")
90+
end
91+
end
9392

94-
done()
93+
done()
9594
end)
9695

97-
test_utils.on_session_end(function ()
96+
test_utils.on_session_end(function()
9897
done()
9998
end)
10099

101100
dap.run(launch_config)
102101
end, 1)
103102
)
104-
105103
end)
106104
end)

tests/lua/__dap_js_test_util.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ M.id = "___dap_js_test"
1212
local util_id = "___dap_js_test_utils"
1313

1414
-- local current_session
15-
local current_sessions = { }
15+
local current_sessions = {}
1616

1717
function M.clear_listeners()
1818
for _, time in ipairs({ "before", "after" }) do
@@ -34,7 +34,7 @@ function M.reset()
3434
M.clear_listeners()
3535
M.clear_config()
3636
M.clear_breakpoints()
37-
current_sessions = { }
37+
current_sessions = {}
3838
end
3939

4040
function M.set_breakpoint(lnum, bufnr, opts)
@@ -52,17 +52,17 @@ function M.add_listener(time, event_or_command, callback)
5252
end
5353

5454
function M.on_session_end(callback)
55-
M.add_listener('after', 'event_terminated', function (session, ...)
56-
current_sessions[session] = nil
55+
M.add_listener("after", "event_terminated", function(session, ...)
56+
current_sessions[session] = nil
5757

58-
local active_sessions = vim.tbl_filter(function (el)
59-
return js_session.is_session_registered(el)
60-
end, vim.tbl_keys(current_sessions))
58+
local active_sessions = vim.tbl_filter(function(el)
59+
return js_session.is_session_registered(el)
60+
end, vim.tbl_keys(current_sessions))
6161

62-
if #active_sessions == 0 then
63-
callback(session, ...)
64-
end
65-
end)
62+
if #active_sessions == 0 then
63+
callback(session, ...)
64+
end
65+
end)
6666
end
6767

6868
function M.setup_dapjs(config)
@@ -71,7 +71,7 @@ function M.setup_dapjs(config)
7171
}, config or {}))
7272

7373
dap.listeners.before["event_initialized"][util_id] = function(session)
74-
current_sessions[session] = true
74+
current_sessions[session] = true
7575
end
7676
end
7777

0 commit comments

Comments
 (0)