diff --git a/doc/neotest.txt b/doc/neotest.txt index ff8278bc..6ba9e48f 100644 --- a/doc/neotest.txt +++ b/doc/neotest.txt @@ -1,6 +1,8 @@ *neotest.txt* A framework to interact with tests within NeoVim ============================================================================== +neotest *neotest* + Setup......................................................|neotest.setup()| Configuration Options.......................................|neotest.config| Consumers................................................|neotest.consumers| @@ -46,9 +48,6 @@ See the table of contents for the consumers < -neotest *neotest* - - *neotest.setup()* `setup`({user_config}) @@ -333,15 +332,7 @@ neotest.output *neotest.output* A consumer that displays the output of test results. - *neotest.output.open()* -`open`({opts}) - -Open the output of a test result -> - lua require("neotest").output.open({ enter = true }) -< -Parameters~ -{opts} `(table?)` + *neotest.consumers.output.OpenArgs* Fields~ {open_win} `(function)` Function that takes a table with width and height keys and opens a window for the output. If a window ID is not returned, the current @@ -355,6 +346,16 @@ position if not given {adapter} `(string)` Adapter ID, defaults to first found with matching position {auto_close} `(boolean)` Close output window when leaving it, or when cursor moves outside of window + *neotest.output.open()* +`open`({opts}) + +Open the output of a test result +> + lua require("neotest").output.open({ enter = true }) +< +Parameters~ +{opts?} `(neotest.consumers.output.OpenArgs)` + ============================================================================== neotest.output_panel *neotest.output_panel* @@ -420,8 +421,7 @@ Debug the current file with nvim-dap lua require("neotest").run.run({vim.fn.expand("%"), strategy = "dap"}) < Parameters~ -{args} `(string|neotest.run.RunArgs?)` Position ID to run or args. If args then args[1] should -be the position ID. +{args} `(string|neotest.run.RunArgs?)` Position ID to run or args. If args then args[1] should be the position ID. *neotest.run.run_last()* `run_last`({args}) @@ -440,16 +440,13 @@ nvim-dap lua require("neotest").run.run_last({ strategy = "dap" }) < Parameters~ -{args} `(table)` Arguments to run with +{args} `(neotest.run.RunArgs?)` Argument overrides + + *neotest.run.StopArgs* +Inherits: `neotest.client.StopArgs` Fields~ -{adapter} `(string)` Adapter ID, if not given the same adapter as the last run -is used. -{strategy} `(string|neotest.Strategy)` Strategy to run commands with -{extra_args} `(string[])` Extra arguments for test command -{env} `(table)` Extra environment variables to add to the -environment of tests -{concurrent} `(boolean)` Run tests concurrently when an adapter provides multiple commands to run +{interactive} `(boolean)` Select a running position interactively *neotest.run.stop()* `stop`({args}) @@ -457,11 +454,13 @@ environment of tests Stop a running process Parameters~ -{args} `(string|table?)` Position ID to stop or args. If args then args[1] -should be the position ID. +{args} `(string|neotest.run.StopArgs?)` Position ID to stop or args. If +args then args[1] should be the position ID. + + *neotest.run.AttachArgs* +Inherits: `neotest.client.AttachArgs` + Fields~ -{adapter} `(string)` Adapter ID, if not given the first adapter found with -chosen position is used. {interactive} `(boolean)` Select a running position interactively *neotest.run.attach()* @@ -470,25 +469,22 @@ chosen position is used. Attach to a running process for the given position. Parameters~ -{args} `(string|table?)` Position ID to attach to or args. If args then +{args} `(string|neotest.run.AttachArgs?)` Position ID to attach to or args. If args then args[1] should be the position ID. -Fields~ -{adapter} `(string)` Adapter ID, if not given the first adapter found with -chosen position is used. -{interactive} `(boolean)` Select a running position interactively - *neotest.run.adapters()* `adapters`() Get the list of all known adapter IDs. +Return~ +`(string[])` *neotest.run.get_last_run()* `get_last_run`() -Get last test run tree and adapter id. +Get last test position ID and args Return~ -`(string)` | nil, table | nil Position id and last args table +`(string|nil,neotest.run.RunArgs|nil)` Position id and last args table ============================================================================== @@ -545,36 +541,33 @@ the summary window lua require("neotest").summary.toggle() + *neotest.summmary.RunMarkedArgs* +Inherits: `neotest.run.RunArgs` + + *neotest.summary.run_marked()* `run_marked`({args}) Run all marked positions Parameters~ -{args} `(table)` - -Fields~ -{adapter} `(string)` Adapter ID, if not given all adapters are used -{strategy} `(string|neotest.Strategy)` Strategy to run commands with -{extra_args} `(string[])` Extra arguments for test command -{env} `(table)` Extra environment variables to add to the -environment of tests +{args?} `(neotest.summmary.RunMarkedArgs)` *neotest.summary.marked()* `marked`() Return a table of all marked positions +@return table -@return table + *neotest.summary.ClearMarkedArgs* +Fields~ +{adapter?} `(string)` Adapter ID, if not given all adapters are cleared *neotest.summary.clear_marked()* `clear_marked`({args}) Clear all marked positions Parameters~ -{args} `(table)` - -Fields~ -{adapter} `(string)` Adapter ID, if not given all adapters are used +{args?} `(neotest.summary.ClearMarkedArgs)` *neotest.summary.target()* `target`({adapter_id}, {position_id}) @@ -597,25 +590,23 @@ Example mappings to jump between test failures nnoremap ]n lua require("neotest").jump.next({ status = "failed" }) < + *neotest.consumers.jump.JumpArgs* +Fields~ +{status} `(string)` Only jump to positions with given status + *neotest.jump.next()* `next`({args}) Jump to the position after the cursor position in the current file Parameters~ -{args} `(table)` Optionals arguments - -Fields~ -{status} `(string)` Only jump to positions with given status +{args?} `(neotest.consumers.jump.JumpArgs)` *neotest.jump.prev()* `prev`({args}) to the position after the cursor position in the current file Parameters~ -{args} `(table)` Optionals arguments - -Fields~ -{status} `(string)` Only jump to positions with given status +{args?} `(neotest.consumers.jump.JumpArgs)` ============================================================================== @@ -898,7 +889,7 @@ Type~ *neotest.lib.files.detect_filetype()* `detect_filetype`({path}) -Detect the filetype of a file by checking the name, extensions, shebang or +Detect the filetype of a file by checking the name, extensions, shebang or modeline. This is a memoized wrapper around plenary's filetype detection. Parameters~ {path} `(string)` @@ -967,7 +958,7 @@ Return~ Filter elements from a list Parameters~ -{f} `(fun(i: integer, v: V): boolean)` +{f} `(fun(v: V): boolean)` {t} `(V[])` Return~ `(V[])` @@ -1157,7 +1148,7 @@ Return~ Read a file's contents from disk and parse test positions using the given query. Executed in a subprocess to avoid blocking the editor if possible. Since functions can't be serialised for RPC the build_position and position_id options -can be strings that will evaluate to globally referencable functions +can be strings that will evaluate to globally referencable functions (e.g. `'require("my_adapter")._build_position'`). Parameters~ diff --git a/lua/neotest/client/init.lua b/lua/neotest/client/init.lua index 696e5182..ed87e300 100644 --- a/lua/neotest/client/init.lua +++ b/lua/neotest/client/init.lua @@ -164,7 +164,6 @@ function neotest.Client:get_nearest(file_path, row, args) return nearest, adapter_id end - ---Get all known active adapters ---@async ---@return string[] @@ -265,9 +264,11 @@ function neotest.Client:_update_positions(path, args) -- If existing tree then we have to find the point to merge the trees and update that path rather than trying to -- merge an orphan. This happens when a whole new directory is found (e.g. renamed an existing one). local existing_root = self:get_position(nil, { adapter = adapter_id }) - while existing_root - and vim.startswith(path, existing_root:data().path) - and not self:get_position(path, { adapter = adapter_id }) do + while + existing_root + and vim.startswith(path, existing_root:data().path) + and not self:get_position(path, { adapter = adapter_id }) + do path = lib.files.parent(path) if not vim.startswith(path, existing_root:data().path) then return @@ -281,10 +282,10 @@ function neotest.Client:_update_positions(path, args) lib.files.find(path, { filter_dir = function(...) return (not adapter.filter_dir or adapter.filter_dir(...)) - and ( + and ( not config.projects[root_path].discovery.filter_dir - or config.projects[root_path].discovery.filter_dir(...) - ) + or config.projects[root_path].discovery.filter_dir(...) + ) end, }) ) @@ -337,8 +338,9 @@ function neotest.Client:_get_adapter(position_id, adapter_id) end local root = self._state:positions(a_id) - if (not root or vim.startswith(position_id, root:data().path)) - and (lib.files.is_dir(position_id) or adapter.is_test_file(position_id)) + if + (not root or vim.startswith(position_id, root:data().path)) + and (lib.files.is_dir(position_id) or adapter.is_test_file(position_id)) then return a_id, adapter end @@ -492,12 +494,12 @@ end function neotest.Client:_update_adapters(dir) local adapters_with_root = lib.files.is_dir(dir) and self._adapter_group:adapters_with_root_dir(dir) - or {} + or {} local adapters_with_bufs = - self._adapter_group:adapters_matching_open_bufs(lib.func_util.map(function(i, entry) - return i, entry.root - end, adapters_with_root)) + self._adapter_group:adapters_matching_open_bufs(lib.func_util.map(function(i, entry) + return i, entry.root + end, adapters_with_root)) local found = {} for adapter_id, _ in pairs(self._adapters) do diff --git a/lua/neotest/consumers/diagnostic.lua b/lua/neotest/consumers/diagnostic.lua index 36832d34..605c4fda 100644 --- a/lua/neotest/consumers/diagnostic.lua +++ b/lua/neotest/consumers/diagnostic.lua @@ -230,6 +230,7 @@ local neotest = {} --- --- You can configure the diagnostic API for neotest using the "neotest" namespace ---@seealso |vim.diagnostic.config()| +---@class neotest.consumers.diagnostic neotest.diagnostic = {} neotest.diagnostic = setmetatable(neotest.diagnostic, { __call = function(_, ...) diff --git a/lua/neotest/consumers/jump.lua b/lua/neotest/consumers/jump.lua index 43f75e6a..c10f5a2e 100644 --- a/lua/neotest/consumers/jump.lua +++ b/lua/neotest/consumers/jump.lua @@ -16,6 +16,7 @@ local neotest = {} --- nnoremap [n lua require("neotest").jump.prev({ status = "failed" }) --- nnoremap ]n lua require("neotest").jump.next({ status = "failed" }) --- < +---@class neotest.consumers.jump neotest.jump = {} local get_nearest = function() @@ -84,10 +85,11 @@ local jump_to_next = function(pos, predicate) end end ---- Jump to the position after the cursor position in the current file ----@param args table Optionals arguments ---- +---@class neotest.consumers.jump.JumpArgs ---@field status string Only jump to positions with given status + +--- Jump to the position after the cursor position in the current file +---@param args? neotest.consumers.jump.JumpArgs function neotest.jump.next(args) args = args or {} @@ -108,9 +110,7 @@ function neotest.jump.next(args) end ---Jump to the position after the cursor position in the current file ----@param args table Optionals arguments ---- ----@field status string Only jump to positions with given status +---@param args? neotest.consumers.jump.JumpArgs function neotest.jump.prev(args) args = args or {} async.run(function() diff --git a/lua/neotest/consumers/output.lua b/lua/neotest/consumers/output.lua index dcc53ce0..2273c51a 100644 --- a/lua/neotest/consumers/output.lua +++ b/lua/neotest/consumers/output.lua @@ -92,6 +92,7 @@ local neotest = {} ---@toc_entry Output Consumer ---@text --- A consumer that displays the output of test results. +---@class neotest.consumers.output neotest.output = {} ---@private @@ -129,11 +130,7 @@ local init = function() end end ---- Open the output of a test result ---- > ---- lua require("neotest").output.open({ enter = true }) ---- < ----@param opts table? +---@class neotest.consumers.output.OpenArgs ---@field open_win function Function that takes a table with width and height keys --- and opens a window for the output. If a window ID is not returned, the current --- window will be used @@ -145,6 +142,12 @@ end --- position if not given ---@field adapter string Adapter ID, defaults to first found with matching position ---@field auto_close boolean Close output window when leaving it, or when cursor moves outside of window + +--- Open the output of a test result +--- > +--- lua require("neotest").output.open({ enter = true }) +--- < +---@param opts? neotest.consumers.output.OpenArgs function neotest.output.open(opts) opts = opts or {} if win then diff --git a/lua/neotest/consumers/output_panel/init.lua b/lua/neotest/consumers/output_panel/init.lua index 07697cba..d92394eb 100644 --- a/lua/neotest/consumers/output_panel/init.lua +++ b/lua/neotest/consumers/output_panel/init.lua @@ -11,6 +11,7 @@ local neotest = {} ---@toc_entry Output Panel Consumer ---@text --- A consumer that streams all output of tests to a terminal window. +---@class neotest.consumers.output_panel neotest.output_panel = {} ---@param client neotest.Client diff --git a/lua/neotest/consumers/run.lua b/lua/neotest/consumers/run.lua index 235d0e8d..042499c3 100644 --- a/lua/neotest/consumers/run.lua +++ b/lua/neotest/consumers/run.lua @@ -12,6 +12,7 @@ local neotest = {} ---@toc_entry Run Consumer ---@text --- A consumer providing a simple interface to run tests. +---@class neotest.consumers.run neotest.run = {} ---@private @@ -57,8 +58,7 @@ end --- > --- lua require("neotest").run.run({vim.fn.expand("%"), strategy = "dap"}) --- < ----@param args string|neotest.run.RunArgs? Position ID to run or args. If args then args[1] should ---- be the position ID. +---@param args string|neotest.run.RunArgs? Position ID to run or args. If args then args[1] should be the position ID. function neotest.run.run(args) args = args or {} if type(args) == "string" then @@ -87,15 +87,7 @@ end --- > --- lua require("neotest").run.run_last({ strategy = "dap" }) --- < ----@param args table Arguments to run with ---- ----@field adapter string Adapter ID, if not given the same adapter as the last run ---- is used. ----@field strategy string|neotest.Strategy Strategy to run commands with ----@field extra_args string[] Extra arguments for test command ----@field env table Extra environment variables to add to the ---- environment of tests ----@field concurrent boolean Run tests concurrently when an adapter provides multiple commands to run +---@param args neotest.run.RunArgs? Argument overrides function neotest.run.run_last(args) args = args or {} if not last_run then @@ -128,13 +120,13 @@ local function get_tree_interactive() return elem.position, elem.position end +---@class neotest.run.StopArgs : neotest.client.StopArgs +---@field interactive boolean Select a running position interactively + --- Stop a running process --- ----@param args string|table? Position ID to stop or args. If args then args[1] ---- should be the position ID. ----@field adapter string Adapter ID, if not given the first adapter found with ---- chosen position is used. ----@field interactive boolean Select a running position interactively +---@param args string|neotest.run.StopArgs? Position ID to stop or args. If +--- args then args[1] should be the position ID. function neotest.run.stop(args) args = args or {} if type(args) == "string" then @@ -155,14 +147,13 @@ function neotest.run.stop(args) end) end +---@class neotest.run.AttachArgs : neotest.client.AttachArgs +---@field interactive boolean Select a running position interactively + --- Attach to a running process for the given position. --- ----@param args string|table? Position ID to attach to or args. If args then +---@param args string|neotest.run.AttachArgs? Position ID to attach to or args. If args then --- args[1] should be the position ID. ---- ----@field adapter string Adapter ID, if not given the first adapter found with ---- chosen position is used. ----@field interactive boolean Select a running position interactively function neotest.run.attach(args) args = args or {} if type(args) == "string" then @@ -184,6 +175,7 @@ function neotest.run.attach(args) end --- Get the list of all known adapter IDs. +---@return string[] function neotest.run.adapters() if not client_ready then return {} @@ -191,8 +183,8 @@ function neotest.run.adapters() return client:get_adapters() end ---- Get last test run tree and adapter id. ----@return string | nil, table | nil Position id and last args table +--- Get last test position ID and args +---@return string|nil,neotest.run.RunArgs|nil Position id and last args table function neotest.run.get_last_run() if not last_run then return nil, nil diff --git a/lua/neotest/consumers/status.lua b/lua/neotest/consumers/status.lua index 18fe96fe..ec7f1d0b 100644 --- a/lua/neotest/consumers/status.lua +++ b/lua/neotest/consumers/status.lua @@ -102,7 +102,9 @@ local neotest = {} ---@text --- A consumer that displays the results of tests as signs beside their declaration. --- This consumer is completely passive and so has no interface. +---@class neotest.consumers.status neotest.status = {} + neotest.status = setmetatable(neotest.status, { __call = function(_, ...) return init(...) diff --git a/lua/neotest/consumers/summary/init.lua b/lua/neotest/consumers/summary/init.lua index 339296c3..70b62c44 100644 --- a/lua/neotest/consumers/summary/init.lua +++ b/lua/neotest/consumers/summary/init.lua @@ -62,8 +62,10 @@ local neotest = {} --- A consumer that displays the structure of the test suite, along with results and --- allows running tests. ---@seealso |neotest.Config.summary.mappings| for all mappings in the summary window +---@class neotest.consumers.summary neotest.summary = {} +---@private neotest.summary.render = function(positions) summary:render(positions) end @@ -104,14 +106,10 @@ function neotest.summary.toggle() end) end +---@class neotest.summmary.RunMarkedArgs : neotest.run.RunArgs + --- Run all marked positions ----@param args table ---- ----@field adapter string Adapter ID, if not given all adapters are used ----@field strategy string|neotest.Strategy Strategy to run commands with ----@field extra_args string[] Extra arguments for test command ----@field env table Extra environment variables to add to the ---- environment of tests +---@param args? neotest.summmary.RunMarkedArgs function neotest.summary.run_marked(args) args = args or {} for adapter_id, component in pairs(summary.components) do @@ -128,8 +126,7 @@ function neotest.summary.run_marked(args) end --- Return a table of all marked positions ---- ---- @return table +--- @return table function neotest.summary.marked() local all_marked = {} for adapter_id, component in pairs(summary.components) do @@ -148,10 +145,11 @@ function neotest.summary.marked() return all_marked end +---@class neotest.summary.ClearMarkedArgs +---@field adapter? string Adapter ID, if not given all adapters are cleared + --- Clear all marked positions ----@param args table ---- ----@field adapter string Adapter ID, if not given all adapters are used +---@param args? neotest.summary.ClearMarkedArgs function neotest.summary.clear_marked(args) args = args or {} for adapter_id, component in pairs(summary.components) do diff --git a/lua/neotest/init.lua b/lua/neotest/init.lua index 7ab05c37..65e91a7b 100644 --- a/lua/neotest/init.lua +++ b/lua/neotest/init.lua @@ -1,3 +1,5 @@ +---@tag neotest + ---@toc ---@text --- @@ -27,6 +29,14 @@ --- ---@class neotest +---@field run neotest.consumers.run +---@field summary neotest.consumers.summary +---@field output neotest.consumers.output +---@field output_panel neotest.consumers.output_panel +---@field status neotest.consumers.status +---@field diagnostic neotest.consumers.diagnostic +---@field jump neotest.consumers.jump +---@nodoc local neotest = {} local config = require("neotest.config") diff --git a/lua/neotest/lib/file/init.lua b/lua/neotest/lib/file/init.lua index 8e1e4102..13f9adcc 100644 --- a/lua/neotest/lib/file/init.lua +++ b/lua/neotest/lib/file/init.lua @@ -9,9 +9,9 @@ local Tree = types.Tree local neotest = { lib = {} } ---@toc_entry Library: Files ----@text +---@text --- Helper functions for interacting with files ----@class neotest.lib.files +---@class neotest.lib.files neotest.lib.files = {} --- Read a file asynchronously @@ -214,7 +214,7 @@ neotest.lib.files.sep = (function() return res end)() ----@private +---@nodoc neotest.lib.files.path = { sep = neotest.lib.files.sep, exists = neotest.lib.files.exists, @@ -226,7 +226,7 @@ neotest.lib.files.path = { local memoized_detect = fu.memoize(filetype.detect) ---- Detect the filetype of a file by checking the name, extensions, shebang or +--- Detect the filetype of a file by checking the name, extensions, shebang or --- modeline. This is a memoized wrapper around plenary's filetype detection. ---@param path string ---@return string @@ -234,7 +234,6 @@ function neotest.lib.files.detect_filetype(path) return memoized_detect(path) end - --- Parse a sorted list of file paths into a position tree ---@param files string[] List of files to include in directory tree, along with parents ---@return neotest.Tree @@ -347,7 +346,8 @@ function neotest.lib.files.match_root_pattern(...) return function(start_path) local start_parents = Path:new(start_path):parents() local home = os.getenv("HOME") - local potential_roots = neotest.lib.files.is_dir(start_path) and vim.list_extend({ start_path }, start_parents) + local potential_roots = neotest.lib.files.is_dir(start_path) + and vim.list_extend({ start_path }, start_parents) or start_parents local valid_roots = {} for index, value in ipairs(potential_roots) do diff --git a/lua/neotest/lib/func_util/init.lua b/lua/neotest/lib/func_util/init.lua index f7c47f22..92d0800d 100644 --- a/lua/neotest/lib/func_util/init.lua +++ b/lua/neotest/lib/func_util/init.lua @@ -52,13 +52,13 @@ end --- Filter elements from a list ---@generic V ----@param f fun(i: integer, v: V): boolean +---@param f fun(v: V): boolean ---@param t V[] ---@return V[] function neotest.lib.func_util.filter_list(f, t) local new_t = {} - for i, v in ipairs(t) do - if f(i, v) then + for _, v in ipairs(t) do + if f(v) then new_t[#new_t + 1] = v end end diff --git a/lua/neotest/lib/init.lua b/lua/neotest/lib/init.lua index 600d481d..53f6009b 100644 --- a/lua/neotest/lib/init.lua +++ b/lua/neotest/lib/init.lua @@ -69,5 +69,4 @@ neotest.lib.process = lazy_require("neotest.lib.process") ---@nodoc neotest.lib.subprocess = lazy_require("neotest.lib.subprocess") - return neotest.lib diff --git a/lua/neotest/lib/positions/init.lua b/lua/neotest/lib/positions/init.lua index 824bab70..56eb304f 100644 --- a/lua/neotest/lib/positions/init.lua +++ b/lua/neotest/lib/positions/init.lua @@ -6,7 +6,7 @@ local neotest = { lib = {} } ---@toc_entry Library: Positions ---@text --- Functions for interacting with positions and position trees ----@class neotest.lib.positions +---@class neotest.lib.positions neotest.lib.positions = {} --- Get the nearest position to the given line in the provided file tree @@ -36,7 +36,7 @@ end neotest.lib.positions.contains = function(parent, child) if parent.type == "dir" then return parent.path == child.path - or vim.startswith(child.path, parent.path .. require("neotest.lib.file").sep) + or vim.startswith(child.path, parent.path .. require("neotest.lib.file").sep) end if child.type == "dir" then return false @@ -155,8 +155,9 @@ end ---@param new neotest.Tree File or directory tree ---@private neotest.lib.positions.merge = function(orig, new) - if not neotest.lib.positions.contains(orig:data(), new:data()) - and not neotest.lib.positions.contains(new:data(), orig:data()) + if + not neotest.lib.positions.contains(orig:data(), new:data()) + and not neotest.lib.positions.contains(new:data(), orig:data()) then while not neotest.lib.positions.contains(orig:data(), new:data()) do orig = wrap_with_parent(orig) diff --git a/lua/neotest/lib/process/init.lua b/lua/neotest/lib/process/init.lua index c89dc0d9..c648d2ed 100644 --- a/lua/neotest/lib/process/init.lua +++ b/lua/neotest/lib/process/init.lua @@ -5,7 +5,7 @@ local neotest = { lib = {} } ---@text --- Utilities to run external processes easily. --- More complex use cases should use the lower level jobstart or vim.loop.spawn ----@class neotest.lib.process +---@class neotest.lib.process neotest.lib.process = {} ---@class neotest.lib.process.RunArgs diff --git a/lua/neotest/lib/subprocess.lua b/lua/neotest/lib/subprocess.lua index 4bfcfc81..004cd600 100644 --- a/lua/neotest/lib/subprocess.lua +++ b/lua/neotest/lib/subprocess.lua @@ -5,13 +5,13 @@ local child_chan, parent_chan local callbacks = {} local next_cb_id = 1 local enabled = false -local neotest = { lib = {}} +local neotest = { lib = {} } ---@toc_entry Library: Subprocess ---@text --- Module to interact with a child Neovim instance. --- This can be used for CPU intensive work like treesitter parsing. --- All usage should be guarded by checking that the subprocess has been started using the `enabled` function. ----@class neotest.lib.subprocess +---@class neotest.lib.subprocess neotest.lib.subprocess = {} local function cleanup() diff --git a/lua/neotest/lib/treesitter/init.lua b/lua/neotest/lib/treesitter/init.lua index 8600ea07..77e81f40 100644 --- a/lua/neotest/lib/treesitter/init.lua +++ b/lua/neotest/lib/treesitter/init.lua @@ -10,7 +10,7 @@ local neotest = { lib = {} } ---@toc_entry Library: Treesitter ---@text --- Functions to help parse files with treesitter, optimised for test parsing. ----@class neotest.lib.treesitter +---@class neotest.lib.treesitter neotest.lib.treesitter = {} local function get_match_type(captured_nodes) @@ -165,7 +165,7 @@ end --- Read a file's contents from disk and parse test positions using the given query. --- Executed in a subprocess to avoid blocking the editor if possible. --- Since functions can't be serialised for RPC the build_position and position_id options ---- can be strings that will evaluate to globally referencable functions +--- can be strings that will evaluate to globally referencable functions --- (e.g. `'require("my_adapter")._build_position'`). ---@async ---@param file_path string diff --git a/lua/neotest/lib/ui/init.lua b/lua/neotest/lib/ui/init.lua index 0fe8b66c..231355dd 100644 --- a/lua/neotest/lib/ui/init.lua +++ b/lua/neotest/lib/ui/init.lua @@ -7,7 +7,7 @@ local neotest = { lib = {} } ---@toc_entry Library: UI ---@text --- Helper functions for UI related tasks. ----@class neotest.lib.ui +---@class neotest.lib.ui neotest.lib.ui = {} neotest.lib.ui.float = require("neotest.lib.ui.float") diff --git a/lua/neotest/lib/xml/init.lua b/lua/neotest/lib/xml/init.lua index 4fed493a..e4f661ed 100644 --- a/lua/neotest/lib/xml/init.lua +++ b/lua/neotest/lib/xml/init.lua @@ -7,7 +7,7 @@ local neotest = { lib = {} } ---@text --- Library to parse XML strings. --- Originially taken from https://github.com/manoelcampos/xml2lua ----@class neotest.lib.xml +---@class neotest.lib.xml neotest.lib.xml = {} ---@param xml_data string diff --git a/lua/neotest/types/fanout_accum.lua b/lua/neotest/types/fanout_accum.lua index 8ef2c6af..863300b4 100644 --- a/lua/neotest/types/fanout_accum.lua +++ b/lua/neotest/types/fanout_accum.lua @@ -1,4 +1,3 @@ - local neotest = {} --- Accumulates provided data and stores it, while sending to consumers.