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

doc: introduce rocks.troubleshooting + UX tweaks #435

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/rocks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ RocksOpts *RocksOpts*
{luarocks_config?} (string) Path to the luarocks config. If not set, rocks.nvim will create one in `rocks_path`. Warning: You should include the settings in the default luarocks-config.lua before overriding this.


*rocks.troubleshooting*

What to do when an installation fails ?
1. fall back to https://github.com/nvim-neorocks/rocks-git.nvim (cons: doesn't list dependencies)
2. Add the plugin to luarocks.org <link on guide how to do that?

==============================================================================
Lua API for rocks.nvim extensions *rocks.api*

Expand Down
7 changes: 7 additions & 0 deletions lua/rocks/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ local config = {}
---@type RocksOpts | fun():RocksOpts
vim.g.rocks_nvim = vim.g.rocks_nvim

---@tag rocks.troubleshooting
---@brief [[
---
---What to do when an installation fails ?
---1. fall back to https://github.com/nvim-neorocks/rocks-git.nvim (cons: doesn't list dependencies)
---2. Add the plugin to luarocks.org <link on guide how to do that?
---@brief ]]
return config
4 changes: 3 additions & 1 deletion lua/rocks/operations/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,9 @@ operations.add = function(arg_list, callback)
local stderr = installed_rock
---@cast stderr string
local not_found = stderr:match("No results matching query were found") ~= nil
local message = ("Installation of %s failed. Run ':Rocks log' for details."):format(rock_name)
local message = ("Installation of %s failed. Run ':Rocks log' for details and :h rocks.troubleshooting"):format(
rock_name
)
if not_found then
message = ("Could not find %s %s"):format(rock_name, version or "")
end
Expand Down
Loading