Lazy loading buggy until opening summery window
See original GitHub issueDescribe the bug
I’m a big fan of loading plugins lazy when they become necessary (e.g. I don’t need this plugin until I actually want to run a test or for writing an email not at all).
But apparently this does not work. The plugin gets loaded and the commands etc are their. But if I run :Ultest
or :UltestNearest
, nothing happens. Silence. I added some debugging messages to the VimL stuff. And I can trace it down to this call where it switches to Python. In python I don’t anything to print. No clue what is happening here. If I execute :echo call('_ultest_run_all', ['path/to/file'])
it always just prints 1
. So the plugin is loaded and it basically does something. Just that nothing happens…
When I open the summary window with :UltestSummary
and then go to a test case and hit r
to execute the case, it works. From now on I can also call :Ultest
and :UltestNearest
.
If I turn of the lazy loading of the plugin and always source it at startup, it just works and I can call :Ultest
right away.
Logs should be created using ULTEST_LOG_LEVEL=DEBUG ULTEST_LOG_FILE=vim-ultest.log nvim <test-file>
and added here as well
11:36:06 | INFO | MainThread | logging.py:create_logger:71 | Logger created
11:36:06 | DEBUG | MainThread | __init__.py:__init__:40 | Handler created
11:36:06 | DEBUG | Thread-1 | jobs.py:_handle_coroutine:42 | Starting job with group run_all
11:36:06 | INFO | Thread-1 | __init__.py:run:101 | Running all tests in src/main.rs
11:36:06 | DEBUG | Thread-1 | jobs.py:_handle_coroutine:57 | Finished job with group run_all
To Reproduce
This assumes that vim-test
is always available in path (simplification for the moment of testing). So this is the packer.nvim
configuration:
lua packer.use({
\ 'rcarriga/vim-ultest',
\ run = ':UpdateRemotePlugins',
\ cmd = {'Ultest', 'UltestNearest', 'UltestSummary'},
\ })
Expected behavior
The plugin works after it got loaded and you can execute :Ultest
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (7 by maintainers)
OK now should be working without any issue, just like normal loading.
I’ll leave this open and close it once I’ve implemented the forced update. I don’t think it’s fair to say that lazy loading works well until then