forked from niuiic/blink-cmp-rg.nvim
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: extract debug functions to a separate module
- Loading branch information
1 parent
db1fa9c
commit e5f03e8
Showing
2 changed files
with
33 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
local M = {} | ||
|
||
-- selene: allow(global_usage) | ||
_G.blink_ripgrep_invocations = _G.blink_ripgrep_invocations or {} | ||
|
||
--- Add the invocation to the global list of invocations so that they can be | ||
--- asserted against in tests. Otherwise the tests cannot reliably verify that | ||
--- something did or not happen. | ||
---@param invocation unknown | ||
function M.add_debug_invocation(invocation) | ||
-- selene: allow(global_usage) | ||
table.insert(_G.blink_ripgrep_invocations, invocation) | ||
end | ||
|
||
--- Variant of vim.notify that does not display the messages to the user until | ||
--- they execute `:messages`. Displaying the messages might disturb the user or | ||
--- interfere with tests. | ||
---@param message string | ||
function M.add_debug_message(message) | ||
vim.api.nvim_exec2(string.format("echomsg '%s'", message), {}) | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters