question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lazy loading buggy until opening summery window

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rcarrigacommented, Mar 27, 2021

OK now should be working without any issue, just like normal loading.

1reaction
rcarrigacommented, Mar 24, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy loading - Web performance | MDN
Lazy loading can occur on different moments in the application, but it typically happens on some user interactions such as scrolling and ...
Read more >
Intelligent lazy loading of tabs when Chrome launches with ...
When Chrome is running, this will just behave as an "Open New Window" option ... I would like to see "Wait for tab...
Read more >
Browser-level image lazy loading for the web - web.dev
Images that are eagerly loaded can be fetched right away, while images which are loaded lazily the browser currently needs to wait until...
Read more >
jQuery LazyLoad do not load images until scroll - Stack Overflow
Its really simple, it just makes an window.resize on the scroll event from body and ... of Lazyload triggers the initial update upon...
Read more >
Lazy Loading Individual Vue Components and Prefetching
The purpose of lazy loading is to postpone downloading parts of your application that are not needed by the user on the initial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found