Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ensure plugin runtime paths are available before rocks initialises #285

Merged
merged 7 commits into from
Apr 24, 2024

Conversation

mrcjkb
Copy link
Member

@mrcjkb mrcjkb commented Apr 19, 2024

With this PR, rocks.nvim maintains symlinks to the plugin runtime paths in site/pack/luarocks/opt.

Because the symlinks are all in opt, they are available on the runtimepath before rocks.nvim initialises, but none of the plugin, after/plugin or ftdetect directories are sourced (rocks.nvim takes care of this for non-opt plugins).

This brings with it some nice benefits:

  • People who don't use rocks-config.nvim won't encounter the footgun of not being able to call colorscheme <scheme> in their init.lua, as they might be used to from a traditional plugin manager (see Loading colorscheme (tokyonight.nvim) #212).
  • autoload directories of dependencies are available on the runtimepath, which means vimscript plugins can be installed as dependencies.

Not yet implemented (TODO):

  • Integration tests
  • With this change, the implementation of rocks.runtime.packadd can probably be replaced by a call to Neovim's built-in packadd [needs triage].
    If this is the case, we can deprecate :Rocks packadd and require("rocks").packadd: vim.deprecate("rocks.packadd", "vim.cmd.packadd", "3.0.0", "rocks.nvim").

@mrcjkb mrcjkb added the enhancement New feature or request label Apr 19, 2024
@mrcjkb mrcjkb self-assigned this Apr 19, 2024
@mrcjkb mrcjkb marked this pull request as draft April 19, 2024 12:32
Copy link
Contributor

github-actions bot commented Apr 19, 2024

Review Checklist

Does this PR follow the Contribution Guidelines? Following is a partial checklist:

Proper conventional commit scoping:

  • For example, fix(installer): some installer bugfix

  • Pull request title has the appropriate conventional commit prefix.

If applicable:

  • Tested
    • Tests have been added.
    • Tested manually (steps in PR description).
  • Updated documentation.

@mrcjkb mrcjkb force-pushed the site-symlinks branch 4 times, most recently from acdc4df to 931ffff Compare April 22, 2024 17:47
@mrcjkb mrcjkb marked this pull request as ready for review April 22, 2024 21:11
@mrcjkb
Copy link
Member Author

mrcjkb commented Apr 22, 2024

Let's get this merged and I'll look into deprecating :Rocks packadd in another PR.

@vhyrro
Copy link
Collaborator

vhyrro commented Apr 24, 2024

Down to deprecate packadd as well. New changes look good to me!

@mrcjkb mrcjkb merged commit 462379d into master Apr 24, 2024
10 checks passed
@mrcjkb mrcjkb deleted the site-symlinks branch April 24, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants