Git Product home page Git Product logo

rocks.nvim's Introduction


rocks.nvim


Explore the docs »

Report Bug · Request Feature · Ask Question

A modern approach to Neovim plugin management!

🌒

🌟 Features

  • Cargo-like rocks.toml file for declaring all your plugins.
  • Name-based installation ("nvim-neorg/neorg" becomes :Rocks install neorg instead).
  • Automatic dependency and build script management.
  • Supports multiple versions of the same dependency.
  • True semver versioning!
  • Minimal, non-intrusive UI.
  • Async execution.
  • Extensible, with a Lua API.
  • Command completions for plugins and versions on luarocks.org.
  • Binary rocks pulled from rocks-binaries so you don't have to compile them.

demo

🌔 Introduction

rocks.nvim revolutionizes Neovim plugin management by streamlining the way users and developers handle plugins and dependencies. Integrating directly with luarocks, this plugin offers an automated approach that shifts the responsibility of specifying dependencies and build steps from users to plugin authors.

❔ Why rocks.nvim

The traditional approach to Neovim plugin management often places an unjust burden on users.

Consider the following example using lazy.nvim:

{
  'foo/bar.nvim',
  dependencies = {
    'nvim-lua/plenary.nvim',
    'MunifTanjim/nui.nvim',
    {
      '4O4/reactivex', -- LuaRocks dependency
      build = function(plugin)
        -- post-install build step required to link the luarocks dependency
        vim.uv.fs_symlink(plugin.dir, plugin.dir .. "/lua", { dir = true })
      end,
    },
  },
  build = "make install" -- Post-install build step of the main plugin
}

This setup illustrates several pain points in the status quo:

  • Manual dependency management: Users are often required to manually specify and manage dependencies.
  • Breaking changes: Updates to a plugin's dependencies can lead to breaking changes for users.
  • Platform-specific instructions: Build instructions and dependencies may vary by platform, adding complexity.
  • Because of this horrible UX, plugin authors have been reluctant to add dependencies, preferring to copy/paste code instead.

rocks.nvim simplifies the above example to:

:Rocks install bar.nvim

Welcome to a new era of Neovim plugin management - where simplicity meets efficiency!

🌌 Philosophy

rocks.nvim itself is designed based on the UNIX philosophy: Do one thing well.

It doesn't dictate how you as a user should configure your plugins. But there's an optional module for those seeking additional configuration capabilities: rocks-config.nvim.

We have packaged many Neovim plugins and tree-sitter parsers for luarocks, and an increasing number of plugin authors have been publishing themselves. Additionally, rocks-git.nvim ensures you're covered even when a plugin isn't directly available on LuaRocks.

🌳 Enhanced tree-sitter support

We're revolutionizing the way Neovim users and plugin developers interact with tree-sitter parsers. With the introduction of the Neovim User Rocks Repository (NURR), we have automated the packaging and publishing of many plugins and curated1 tree-sitter parsers for luarocks, ensuring a seamless and efficient user experience.

When installing, rocks.nvim will also search our rocks-binaries (dev) server, which means you don't even need to compile any parsers on your machine.

Effortless installation for users

If you need a tree-sitter parser for syntax highlighting or other features, you can easily install them with rocks.nvim: :Rocks install tree-sitter-<lang>.

They come bundled with queries, so once installed, all you need to do is run vim.treesitter.start() to enable syntax highlighting2.

Or, you can use our rocks-treesitter.nvim module, which can automatically install parsers and enable syntax highlighting for you.

Warning

  • Tree-sitter is an experimental feature of Neovim. As is the case with nvim-treesitter, please consider tree-sitter support in rocks.nvim experimental.

  • We are not affiliated with the nvim-treesitter maintainers. If you are facing issues with tree-sitter support in rocks.nvim, please don't bug them.

Simplifying dependencies

For plugin developers, specifying a tree-sitter parser as a dependency is now as straightforward as including it in their project's rockspec3. This eliminates the need for manual parser management and ensures that dependencies are automatically resolved and installed.

Example rockspec dependency specification:

dependencies = {
  "neotest",
  "tree-sitter-haskell"
}

📝 Requirements

  • An up-to-date Neovim nightly (>= 0.10) installation.
  • The git command line utility.
  • wget or curl (if running on a UNIX system) - required for the remote :source command to work.
  • netrw enabled in your Neovim configuration - enabled by default but some configurations manually disable the plugin.
  • A lua 5.1 installation (for luarocks).

Important

If you are running on an esoteric architecture, rocks.nvim will attempt to compile its dependencies instead of pulling a prebuilt binary. For the process to succeed you must have a C++17 parser and Rust toolchain installed on your system.

📥 Installation

⚡ Installation script (recommended)

The days of bootstrapping and editing your configuration are over. rocks.nvim can be installed directly through an interactive installer within Neovim.

We suggest starting nvim without loading RC files, such that already installed plugins do not interfere with the installer:

nvim -u NORC -c "source https://raw.githubusercontent.com/nvim-neorocks/rocks.nvim/master/installer.lua"

Important

For security reasons, we recommend that you read :help :source and the installer code before running it so you know exactly what it does.

Tip

To configure the luarocks installation to use a specific lua install, use environment variables LUA_BINDIR=<Directory of lua binary> and LUA_BINDIR_SET=yes.

For example:

LUA_BINDIR="${XDG_BIN_DIR:-$HOME/.local/bin}" LUA_BINDIR_SET=yes nvim -u NORC -c "source ...

🔨 Manual installation

For manual installation, see this tutorial.

📚 Usage

Installing rocks

You can install rocks with the :Rocks install {rock} {version?} {args[]?} command.

Arguments:

  • rock: The luarocks package.
  • version: Optional. Used to pin a rock to a specific version.
  • args[]: Optional arguments, e.g. opt=true, to prevent rocks.nvim from automatically sourcing a rock at startup.

Examples:

:Rocks install neorg
:Rocks install neorg 8.0.0
:Rocks install tree-sitter-toml dev
:Rocks install kanagawa.nvim opt=true

Note

  • The command provides fuzzy completions for rocks and versions on luarocks.org.
  • Installs the latest version if version is omitted.
  • This plugin keeps track of installed plugins in a rocks.toml file, which you can commit to version control.
  • If you specify dev or scm as the version, luarocks will search the dev manifest. This has the side-effect that it will prioritise dev versions of any dependencies that aren't declared with version constraints.

Updating rocks

Running the :Rocks update command will attempt to update every available rock if it is not pinned.

Syncing rocks

The :Rocks sync command synchronizes the installed rocks with the rocks.toml.

Note

  • Installs missing rocks.
  • Ensures that the correct versions are installed.
  • Uninstalls unneeded rocks.

Uninstalling rocks

To uninstall a rock and any of its dependencies, that are no longer needed, run the :Rocks prune {rock} command.

Note

  • The command provides fuzzy completions for rocks that can safely be pruned without breaking dependencies.

Editing rocks.toml

The :Rocks edit command opens the rocks.toml file for manual editing. Make sure to run :Rocks sync when you are done.

Lazy loading plugins

By default, rocks.nvim will source all plugins at startup. To prevent it from sourcing a plugin, you can specify opt = true in the rocks.toml file.

For example:

[plugins]
neorg = { version = "1.0.0", opt = true }

or

[plugins.neorg]
version = "1.0.0"
opt = true

You can then load the plugin with the :Rocks[!] packadd {rock} command. Or, before rocks.nvim is initialised, with require("rocks").packadd("<rock_name>").

Note

A note on loading rocks

Luarocks packages are installed differently than you are used to from Git repositories.

Specifically, luarocks installs a rock's Lua API to the package.path and the package.cpath. It does not have to be added to Neovim's runtime path (e.g. using :Rocks packadd), for it to become available. This does not impact Neovim's startup time.

Runtime directories (:h runtimepath), on the other hand, are installed to a separate location. Plugins that utilise these directories may impact startup time (if it has ftdetect or plugin scripts), so you may or may not benefit from loading them lazily.

Tip

Should I lazy load plugins?

Making sure a plugin doesn't unnecessarily impact startup time should be the responsibility of plugin authors, not users. As is the case with dependencies, a plugin's functionality may evolve over time, potentially leading to breakage if it's the user who has to worry about lazy loading.

A plugin that implements its own lazy initialization properly will likely have less overhead than the mechanisms used by a plugin manager or user to load that plugin lazily.

If you find a plugin that takes too long to load, or worse, forces you to load it manually at startup with a call to a heavy setup function, consider opening an issue on the plugin's issue tracker.

📦 Extending rocks.nvim

This plugin provides a Lua API for extensibility. See :h rocks.api for details.

Following are some examples:

To extend rocks.nvim, simply install a module with :Rocks install, and you're good to go!

🩺 Troubleshooting

The :Rocks log command opens a log file for the current session, which contains the luarocks stderr output, among other logs.

🔗 Related projects

  • luarocks-tag-release: A GitHub action that automates publishing to luarocks.org
  • NURR: A repository that publishes Neovim plugins and tree-sitter parsers to luarocks.org
  • luarocks.nvim: Adds basic support for installing lua rocks to lazy.nvim

📖 License

rocks.nvim is licensed under GPLv3.

💚 Contributing

Contributions are more than welcome! See CONTRIBUTING.md for a guide.

Footnotes

  1. We only upload parsers which we can install in the NURR CI (tested on Linux).

  2. You can put this in a ftplugin/<filetype>.lua, for example. nvim-treesitter is still required for tree-sitter based folding, indentation, etc., but you don't need to configure it to install any parsers.

  3. example.

rocks.nvim's People

Contributors

dotsilas avatar github-actions[bot] avatar gptlang avatar jinzhongjia avatar mihailmihov avatar mrcjkb avatar nstefan002 avatar ntbbloodbath avatar pysan3 avatar teto avatar vhyrro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rocks.nvim's Issues

[QOL]: Display updating message in fidget.nvim

Currently when running :Rocks update a message is only issued after the update checking is complete. It would be nice to first display a message like "Checking for updates..." before displaying anything else (i.e. "Nothing to update!").

[UI] Drop dependency on fidget.nvim?

fidget.nvim, while quite nice, is more than just a notification framework, it would be nice if it can be decoupled. I just wrote my own vim.notify which has a similar look and feel to fidget, if no one is against this I am interested in a pr.

[Bug]: `:Rocks prune` removes rock dependencies that are in `rocks.toml`

To reproduce:

  • :Rocks install luasnip (writes luasnip to rocks.toml)
  • :Rocks install haskell-snippets.nvim (depends on luasnip, writes haskell-snippets.nvim to rocks.toml)
  • :Rocks prune haskell-snippets.nvim

Expected behaviour:

  • haskell-snippets.nvim is removed from rocks.toml
  • Only haskell-snippets.nvim is uninstalled.

Actual behaviour:

  • haskell-snippets.nvim is removed from rocks.toml
  • Both luasnip and haskell-snippets.nvim are uninstalled.

Workaround:

Run :Rocks sync.

Configuring luarocks fails in installer page

Hi! I like the idea of this project and wanted to try it but run into some issues. It's probably some stupid mistake on my part so I apologize in advance.

So, I used the command given in README (:source ...), and the installer page opened up, I didn't change the default values, clicked OK, and then I got the following messages.

Downloading luarocks...
Configuring luarocks...
Configuring luarocks failed:

luarocks packaging requests

If you come across a plugin that isn't on luarocks.org, and you think it should be, you can leave a comment here (or thumbs up on any open PRs).

Attempt to call local 'type' (a string value)

Error detected while processing /home/xiaoshihou/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/rocks.nvim/2.6.1-1/plugin/rocks.lua:               
E5113: Error while calling lua chunk: .../.local/share/nvim/rocks/share/lua/5.1/rocks/runtime.lua:72: attempt to call local 'type' (a string value)

Maybe it's a good idea to rename the variable type

for script, name, type in iter_children(rtp_dir) do

[Module]: `rocks-lsp` module for rocks.toml

  • Diagnostics for outdated rocks
  • Code actions to update/downgrade a rock
  • Completions, e.g. for rocks and versions
  • Hover: luarocks show

Maybe this should be implemented as an external module?

`rocks.api` module that rocks can use to extend rocks.nvim

The idea would be a rocks.api module that exposes functions for

  • (fuzzy?-) searching installed rocks
  • (fuzzy?-) searching rocks on luarocks
  • Adding subcommands to :Rocks
  • Get rocks.toml

so plugins could integrate with rocks.nvim, e.g. with a telescope picker.

[Bug] Plugin dependencies added to `rocks.toml` when updated

As the title says, whenever a plugin dependency gets updated through :Rocks update, it is added as a new entry to the rocks.toml entry, causing some unexpected junk entries.

This one is a bit more hard to reproduce so I cannot really give reliable reproduction steps here, hope it's not a blocker!

Windows support

My nvim version: v0.10.0-dev-2388+gb12d193b4
I install lua and luarocks through scoop install lua-for-windows
Then on rocks.nvim installation I set Set up luarocks (recommended) ?: false
And I get this error

Installing rocks.nvim...
E5108: Error executing lua: ...m-nightly\current\share\nvim\runtime/lua/vim/_system.lua:241: ENOENT: no such file or directory
stack traceback:
	[C]: in function 'error'
	...m-nightly\current\share\nvim\runtime/lua/vim/_system.lua:241: in function 'spawn'
	...m-nightly\current\share\nvim\runtime/lua/vim/_system.lua:332: in function 'system'
	C:\Users\Windows 10\AppData\Local\Temp\nvim.0\ywhunR\0.lua:383: in function <C:\Users\Windows 10\AppData\Local\Temp\nvim.0\ywhunR\0.lua:357>

[Feature] support pinning dependencies

I think it would be very useful to support a lockfile to always install the plugins and their dependencies with the same version if you have to change the Neovim installation either because you installed your dotfiles on another machine or another reason.

Luarocks supports this natively, please take a look at Pinning versions with a lock file.

[Feature]: Keep track of luarocks errors

Currently, operations like Rocks sync fail if a single luarocks CLI operation fails (e.g. when Future.wait() errors).

Instead, we should

  • Keep track of the errors, continuing if one fails
  • Log errors to a log file that can be opened with :Rocks log
  • Report if any errors have occurred (e.g. with the message Sync completed with errors. Run ':Rocks log' for details`).
  • Or, at the end of an operation, in the event of an error, ask the user if they would like to open the log file.

[Feature] Add an API to support lazy loading plugins

This would mean two things:

  • Change the installer to tell users to add vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*")) to their init.lua

  • Add an option to lazy load plugins to rocks.toml (see below snippet)

[plugins]
neorg = { opt = true, version = "1.0.0" }
  • Add a rocks.api.load_plugin(name) function :Rocks[!] packadd {rock} command that allows users or an external module to load plugins manually.

[QOL] `sync` should prune all rocks that can be pruned in one sweep

It takes multiple sweeps.

Example:

  • Install haskell-snippets.nvim and luasnip
  • Delete them from rocks.toml
  • Rocks sync

Expected behaviour:

  • Both plugins, as well as the jsregexp dependency are pruned

Actual behaviour:

  • Only haskell-snippets.nvim is pruned. luasnip can't be pruned yet, if haskell-snippets.nvim isn't pruned first, because it depends on it.
  • It takes more than one call to Rocks sync to actually prune all dependencies.

Potential solutions:

  • Analyze dependencies, then figure out the order in which to prune rocks.
  • repeat <pruning logic> until <no more rocks that depend on installed rocks left in to_prune list>.

[Bug] Invalid directory name generated by installation script

local tempdir = vim.fs.joinpath(vim.fn.stdpath("run"), "luarocks-" .. vim.loop.random(7))

The code vim.loop.random(7) in the above possibly generates a directory name that is treated as invalid by the OS.
For example: luarocks-<a1><ec>^O<98>^^{<f8>.

Therefore, I suggest changing that line to the following:

local tempdir = vim.fs.joinpath(vim.fn.stdpath("run"), string.format("luarocks-%X", math.random(256 ^ 7)))

Lua loading issue

The problem is somewhat hard to describe, so I am going to try my best.
My ~/.config/nvim/after/ftplugin contains some configurations for plugins

dap.lua        
epo.lua        
guard.lua      
lspconfig.lua  
squirrel.lua   
telescope.lua  
treesitter.lua 

If I open nvim in that particular directory, I would get warnings like these:

E5113: Error while calling lua chunk: ./dap.lua:1: loop or previous error loading module 'dap'

dap.lua:

1 local dap = require("dap")

I suspect the lua loader module is confusing the local dap file with the dap directory in my rtp, causing an infinite require cycle.

[BUG]: `:Rocks update` does not respect TOML structure

Current Behaviour

Consider the following rocks.toml:

[plugins]
"sweetie.nvim" = { version = "xxx" }

Upon running :Rocks update, rocks.nvim will forcefully coerce the table down to the following:

[plugins]
"sweetie.nvim" = "xxx"

Expected Behaviour

rocks.nvim should only do this coercion if the type of the plugin is not a table.

[Bug] `Rocks sync` should not invoke `luarocks [install|uninstall|update]` concurrently

This leads to partial uninstalls

To reproduce:

  • Install a bunch of plugins.
  • Remove all plugins from rocks.toml.
  • Run Rocks sync.
  • Wait for it to finish.
  • Run Rocks sync again.

Expected behaviour:

  • Progress message says everything is in sync.

Actual behaviour:

  • An error message is displayed, saying the rockspec of a previously pruned plugin can\t be found.

This appears to be because of an incomplete uninstall.

Excample:

Error executing vim.schedule lua callback: ...pack/myNeovimPackages/start/rocks.nvim/lua/nio/tasks.lua:95: Async task failed without callback: The
coroutine failed with this message:
...ck/myNeovimPackages/start/rocks.nvim/lua/nio/control.lua:107:
Error: Could not load rockspec file /home/mrcjk/.local/share/nvimrocks/rocks/lib/luarocks/rocks-5.1/haskell-snippets.nvim/1.4.2-1/haskell-snippets.
nvim-1.4.2-1.rockspec (/home/mrcjk/.local/share/nvimrocks/rocks/lib/luarocks/rocks-5.1/haskell-snippets.nvim/1.4.2-1/haskell-snippets.nvim-1.4.2-1.
rockspec: No such file or directory)

stack traceback:
        [C]: in function 'error'
        ...ck/myNeovimPackages/start/rocks.nvim/lua/nio/control.lua:107: in function 'wait'
        ...ck/myNeovimPackages/start/rocks.nvim/lua/rocks/state.lua:112: in function 'rock_dependencies'
        ...NeovimPackages/start/rocks.nvim/lua/rocks/operations.lua:275: in function <...NeovimPackages/start/rocks.nvim/lua/rocks/operations.lua:1
54>
stack traceback:
        [C]: in function 'error'
        ...pack/myNeovimPackages/start/rocks.nvim/lua/nio/tasks.lua:95: in function 'close_task'
        ...pack/myNeovimPackages/start/rocks.nvim/lua/nio/tasks.lua:117: in function 'cb'
        ...pack/myNeovimPackages/start/rocks.nvim/lua/nio/tasks.lua:181: in function 'waiter'
        ...ck/myNeovimPackages/start/rocks.nvim/lua/nio/control.lua:81: in function 'wake'
        ...ck/myNeovimPackages/start/rocks.nvim/lua/nio/control.lua:99: in function 'set_error'
        ...ck/myNeovimPackages/start/rocks.nvim/lua/rocks/state.lua:106: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

[Feature] `:Rocks checkhealth` command

  • Neovim's checkhealth doesn't support luarocks packages. See neovim/neovim#26580.

  • To work around this, we could implement a :Rocks checkhealth command, which searches the package.path for <rock>.health modules (perhaps based on the rocks in rocks.toml) and provides completions for rocks in rocks.toml.

  • Both the command and completions should fall back to Neovim's built-in checkhealth (if args are passed to it)

  • For Neovim's checkhealth without any args, rocks.nvim could use autoload/health.vim to run its own health checks + the ones for its plugins.

Feature request: fuzzy completion on `:Rocks install`

Currently we have a pretty decent and performant tab completion for all the available rocks on Luarocks while installing a new plugin, however, it doesn't work with keywords as we are using vim.startswith to filter rocks based on the user query (e.g. :Rocks install nvim will filter rocks that starts with nvim for completion).

However, we could highly improve it by adding some fuzzy filtering with fzy-lua which is also in Luarocks so we could easily add it as a dependency for rocks.nvim so instead of only matching rocks starting with nvim we could match any rock that contains nvim on its name.

[Bug] cannot downgrade `scm` plugins to semver release

rocks.nvim will fail when trying to downgrade from a plugin installed with the development version (scm) to a semantic version of it.

Related files and lines of code:

  • lua/rocks/operations.lua: 340-341

Reproduction steps

  • Install any plugin that has a scm version like telescope.nvim by using :Rocks install telescope.nvim scm-1
  • Edit your rocks.toml file and change the telescope.nvim version from scm to 0.1.5
  • Run :Rocks sync command

Error traceback

bug traceback

sync: do not attempt to remove dependencies

Summary

If a plugin that other plugins depend on is removed from rocks.toml,
rocks.nvim attempts to remove it.

Spec

Given the following rocks.toml:

[plugins]
"haskell-tools.nvim" = "2.3.0" # depends on plenary.nvim
"plenary.nvim" = "0.1.3"

And both plugins have been installed with :Rocks install
When I remove plenary.nvim from the rocks.toml as follows:

[plugins]
"haskell-tools.nvim" = "2.3.0" # depends on plenary.nvim

And I execute :Rocks sync

Expected behaviour

Then nothing happens

Current behaviour

Then the rocks.nvim displays "Removing 'plenary.nvim'"

Implementation details

  • luarocks does not have a way to list dependencies, but luarocks show <rock_name> will list the dependencies of each rock.
  • We could use this on each rock in rocks.toml to gather all dependencies, and then filter the list of rocks to remove accordingly.

[General question] What is the intended configuration when using rocks.nvim as a package manager

So, let's use just one plugin as an example. I just published 2048.nvim to luarocks. I installed it with :Rocks install 2048. And here comes the part that I'm interested in. By default rocks.nvim sources the lua/ directory of the plugin, but unlike lazy.nvim it doesn't automatically call the setup function (as far as I can tell). So I guess that the approach here would be something like this: I have one file with plugin declarations (rocks.toml) and configurations files (e.g. ~/.config/nvim/lua/plugins/2048.lua) where I call the setup function and do customizations if I want to. I know that this could be done in a million different ways, but I just wanted to understand the intended way of doing things and try to adapt to them so I can see the full picture. Let me know if I misunderstood something.

Note: I read the rocks-config.nvim docs, so I have a few more questions about that.

  1. Does this:
[config]
plugins_dir = "plugins/"

do the same thing as I mentioned above (the ~/.config/nvim/lua/plugins/... stuff)? The difference could be that with rocks-config I don't have to manually source the configurations, but without it, I would need to have require('plugins') in ~/.config/nvim/init.lua and then in lua/plugins/init.lua lines such as require('plugins.2048') to source the file that contains my plugin config.

  1. I understood that the auto_setup option is meant to be used when you don't want to pass any arguments to the plugin's setup function (in other words you are satisfied with the default config, or the plugin does not have any configuration options). So is this the equivalent to config = true or opts = {} in lazy.nvim? I'm sorry for creating parallels to lazy but that's currently what most people (including me) are familiar with.

Bug: toml wrong architecture

Error executing Lua callback: ...oguz/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:95: Async task failed without callback: The coroutine failed with this mess
age:
error loading module 'toml_edit' from file '/Users/oguz/.local/share/nvim/rocks/lib/lua/5.1/toml_edit.so':
dlopen(/Users/oguz/.local/share/nvim/rocks/lib/lua/5.1/toml_edit.so, 6): no suitable image found. Did find:
/Users/oguz/.local/share/nvim/rocks/lib/lua/5.1/toml_edit.so: mach-o, but wrong architecture
/Users/oguz/.local/share/nvim/rocks/lib/lua/5.1/toml_edit.so: mach-o, but wrong architecture
stack traceback:
[C]: in function 'require'
...ocal/share/nvim/rocks/share/lua/5.1/rocks/operations.lua:115: in function 'parse_rocks_toml'
...ocal/share/nvim/rocks/share/lua/5.1/rocks/operations.lua:524: in function <...ocal/share/nvim/rocks/share/lua/5.1/rocks/operations.lua:509>
stack traceback:
[C]: in function 'error'
...oguz/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:95: in function 'close_task'
...oguz/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:117: in function 'step'
...oguz/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:145: in function 'run'
...ocal/share/nvim/rocks/share/lua/5.1/rocks/operations.lua:509: in function 'update'
....local/share/nvim/rocks/share/lua/5.1/rocks/commands.lua:98: in function 'impl'
....local/share/nvim/rocks/share/lua/5.1/rocks/commands.lua:181: in function <....local/share/nvim/rocks/share/lua/5.1/rocks/commands.lua:172>

attempt to index local 'ret' (a number value)

Rocks update ->

Error executing vim.schedule lua callback: ...ihou/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:95: Async task failed without callback: The 
coroutine failed with this message:                                                                                                                
...ocal/share/nvim/rocks/share/lua/5.1/rocks/operations.lua:493: attempt to index local 'ret' (a number value)                                     
stack traceback:                                                                                                                                   
        ...ocal/share/nvim/rocks/share/lua/5.1/rocks/operations.lua: in function <...ocal/share/nvim/rocks/share/lua/5.1/rocks/operations.lua:454> 
stack traceback:                                                                                                                                   
        [C]: in function 'error'                                                                                                                   
        ...ihou/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:95: in function 'close_task'                                                   
        ...ihou/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:117: in function 'cb'                                                          
        ...ihou/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:183: in function <...ihou/.local/share/nvim/rocks/share/lua/5.1/nio/tasks.lua:1
82>

This happens with all the rocks-git managed packages commented out, so it should be a rocks.nvim issue.

Any thoughts?

Line wrapping in installer

Sorry guys for spamming issues. This one is nothing special. The word false seemingly disappears from the 2nd option's window in insert mode because of the wrapping (same thing if the user wants to provide a path longer than 50 characters in the 1st option).

2024-01-27.21-12-35.mp4

[Module] `rocks-gh-request` module for requesting plugins to be published to luarocks

Just a rough idea...

  • Extends the Rocks command with
    • A request <owner>/<repo> subcommand that searches existing GitHub issues, and if not found, opens an issue requesting for the plugin to be published to luarocks (based on a template)
    • A pr <owner>/<repo> subcommand that searches PRs, and if not found, opens a luarocks-tag-release PR based on a template.

[Module]: `rocks-dev` for installation of local plugins

I was considering adding this feature as part of rocks.nvim core, but now that I have considered it I feel like it would make more sense to have as an external module.

This module would allow developers to test local, development versions of their plugin without having to push their code to a dev target on luarocks.org.

Idea for syntax:

[plugins.neorg]
dir = "~/dev/neorg/"

# or ...

[plugins]
neorg = { dir = "~/dev/neorg" }

When specified like this the version parameter would simply be ignored. :Rocks sync would not affect these entries. Any plugin that is specified with dir would simply be manually added by rocks-dev to the runtimepath.

[Module]: `rocks-config` for common configuration paradigms

The default (expected) way to handle plugins within one's configuration is to place plugins in a plugins/ RTP directory and check for the existence of the plugin with pcall.

A rocks-config module would allow users to specify per-plugin configuration files (if the plugin is installed and loaded). A global option could also be set which would specify the default directory where files for plugins would be sourced, e.g.:

[plugins]
# plugins go here...

[config]
path = "plugins/" # search in `$CONFIG_DIR/lua/plugins/xyz.lua` for each installed plugin

[BUG]: `:Rocks sync` fails on fresh install

Root Cause

When attempting to figure out dependencies of rocks, rocks.nvim looks through all rocks from the rocks.toml file. The issue is, however, that it's not guaranteed that the rocks from rocks.toml are installed.

Solution

rocks.nvim should pull from state.installed_rocks() instead to resolve this issue.

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.