Skip to content

Commit c1ab4e0

Browse files
committed
hoge
1 parent 8912ecc commit c1ab4e0

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lua/plenary/test_harness.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ local headless = require("plenary.nvim_meta").is_headless
99

1010
local plenary_dir = vim.fn.fnamemodify(debug.getinfo(1).source:match "@?(.*[/\\])", ":p:h:h:h")
1111

12+
---@class PlenaryTestHarness
1213
local harness = {}
1314

15+
---@type fun(_, ...)
1416
local print_output = vim.schedule_wrap(function(_, ...)
1517
for _, v in ipairs { ... } do
1618
io.stdout:write(tostring(v))
@@ -20,7 +22,11 @@ local print_output = vim.schedule_wrap(function(_, ...)
2022
vim.cmd [[mode]]
2123
end)
2224

25+
---@param job_id integer
26+
---@return fun(bufnr: integer, ...: string)
2327
local get_nvim_output = function(job_id)
28+
---@param bufnr integer
29+
---@param ... string
2430
return vim.schedule_wrap(function(bufnr, ...)
2531
if not vim.api.nvim_buf_is_valid(bufnr) then
2632
return
@@ -31,6 +37,8 @@ local get_nvim_output = function(job_id)
3137
end)
3238
end
3339

40+
---@param command string
41+
---@return nil
3442
function harness.test_directory_command(command)
3543
local split_string = vim.split(command, " ")
3644
local directory = vim.fn.expand(table.remove(split_string, 1))
@@ -40,6 +48,19 @@ function harness.test_directory_command(command)
4048
return harness.test_directory(directory, opts)
4149
end
4250

51+
---@class PlenaryTestHarnessOptions
52+
---@field init? string
53+
---@field keep_going? boolean
54+
---@field minimal? boolean
55+
---@field minimal_init? string
56+
---@field nvim_cmd? string
57+
---@field sequential? boolean
58+
---@field timeout? integer
59+
---@field winopts? PlenaryWindowFloatOptions
60+
61+
---@param paths string[]
62+
---@param opts? PlenaryTestHarnessOptions
63+
---@return nil
4364
local function test_paths(paths, opts)
4465
local minimal = not opts or not opts.init or opts.minimal or opts.minimal_init
4566

@@ -53,6 +74,7 @@ local function test_paths(paths, opts)
5374

5475
vim.env.PLENARY_TEST_TIMEOUT = opts.timeout
5576

77+
---@type { bufnr: integer, win_id: integer, border_bufnr: integer, border_win_id: integer, job_id: integer }
5678
local res = {}
5779
if not headless then
5880
res = win_float.percentage_range_window(0.95, 0.70, opts.winopts)

lua/plenary/window/float.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ end
154154
---@param row_range integer
155155
---@param win_opts? PlenaryWindowFloatOptions
156156
---@param border_opts? PlenaryWindowBorderBorderOptions
157-
---@return table
157+
---@return { bufnr: integer, win_id: integer, border_bufnr: integer, border_win_id: integer }
158158
function win_float.percentage_range_window(col_range, row_range, win_opts, border_opts)
159159
win_opts = tbl.apply_defaults(win_opts, win_float.default_options)
160160

0 commit comments

Comments
 (0)