Git Product home page Git Product logo

Comments (2)

mrcjkb avatar mrcjkb commented on May 20, 2024 1

will the function work based on the name of the plugin or the name of its Lua module

plugin name.

I just saw the proposal for the rocks-lazy module and its possible configuration. Would the proposal mentioned here serve to make things easier or will an internal wrapper be created in that module?

I think the rocks.nvim API should be as simple as possible.
That is, no lazy loading logic whatsoever. We just provide the API for loading the plugins manually, and the opt config option that allows users to prevent rocks.nvim from eagerly loading the plugins.

Any lazy loading logic and additional options should be the responsibility of the external module.
For example rocks-git.nvim adds a bunch of fields (git, rev, build, ...) to the rocks.toml schema. rocks.nvim itself knows nothing about these fields. It simply sends the config to the injected handler, which detects if it has a git field and does something with it.

from rocks.nvim.

NTBBloodbath avatar NTBBloodbath commented on May 20, 2024

To keep the lazy loading to just what is necessary, I think adding an opts table to the API function that accepts two possible arguments (ft and event) for faster integration could be nice. For example, to have nvim-lspconfig loaded only on certain filetypes in which you have its LSP installed in your system. Here is an example

--- Load lspconfig only in the following filetypes
--- as I have installed their LSPs for daily use
rocks.api.load_plugin("lspconfig", {
    ft = { "lua", "python", "haskell" },
})

Ps: will the function work based on the name of the plugin or the name of its Lua module (e.g. nvim-lspconfig or lspconfig)?


Edit: I don't think that both table options should coexist if implemented, I don't know if it could cause bugs in some plugins or create race conditions in some others.

Edit 2: I just saw the proposal for the rocks-lazy module and its possible configuration. Would the proposal mentioned here serve to make things easier or will an internal wrapper be created in that module?

from rocks.nvim.

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.