Giter VIP home page Giter VIP logo

Comments (6)

pedro757 avatar pedro757 commented on August 18, 2024

I can do it but I just want confirmation if this is the right way to go or maybe I am missing something.

from neotest.

rcarriga avatar rcarriga commented on August 18, 2024

There is absolutely no reason to lazy load neotest, there is no code except in the lua directory which is only run when manually calling require("neotest"). vim-ultest had code that ran on startup which is why lazy loading was useful

from neotest.

pedro757 avatar pedro757 commented on August 18, 2024

Its dependencies still load on VimEnter, for example vim-test, but maybe this issue is out of scope.

from neotest.

rcarriga avatar rcarriga commented on August 18, 2024

Packer supports lazy loading lua modules, so you can use that.

  module = string or list      -- Specifies Lua module names for require. When requiring a string which starts
                               -- with one of these module names, the plugin will be loaded.

from neotest.

pedro757 avatar pedro757 commented on August 18, 2024

I think that feature is not related to this problem. it's for naming modules so you can call them in other places.

I ran vim --startuptime h.log and I got this:
image

This is what I mean, I noticed a change in the startuptime when switching from the vim-ultest to neotest, Is there a way to just load this plugin when I press certain keys like I used to do in vim-ultest

      keys = {
        "<Plug>(ultest-run-nearest)",
        "<Plug>(ultest-run-file)",
        "<Plug>(ultest-summary-toggle)",
      },

I know this is just a triviality but I don't like spending 6 ms in neotest-python, 4 ms in neotest.lib 3 ms in neotest-jest.
I don't even use this plugin on a daily basis, I just want to load it when I need it.

from neotest.

rcarriga avatar rcarriga commented on August 18, 2024

module definitely does lazy load neotest, if you're seeing it load on startup it's because you're calling it in your config. If you don't want to use that, you can define your own mappings that are used for lazy loading

from neotest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.