fix rest.nvim setup

This commit is contained in:
mathias committed 2026-10-11 14:13:03 +02:00
1 parent fc5282d698
commit a21331d225
1 file changed
+16
+16
View File
@@ -94,6 +94,22 @@ return {
{ {
-- HTTP REST-Client Interface -- HTTP REST-Client Interface
'rest-nvim/rest.nvim', 'rest-nvim/rest.nvim',
-- The tree-sitter-http rock needs a luarocks build backend inside the hererocks tree,
-- but lazy installs it into the plugin's own tree where luarocks can't find it.
-- Done in `init` because overriding `build` breaks lazy's rockspec handling; lazy
-- retries the failed rockspec build on the next start once the backend is there.
init = function()
local hererocks = require('lazy.core.config').options.rocks.root .. '/hererocks'
local luarocks = hererocks .. '/bin/luarocks'
local backend = hererocks .. '/share/lua/5.1/luarocks/build/treesitter-parser.lua'
if vim.fn.executable(luarocks) == 0 or vim.uv.fs_stat(backend) then
return
end
local result = vim.system({ luarocks, 'install', 'luarocks-build-treesitter-parser' }):wait()
if result.code ~= 0 then
vim.notify('rest.nvim: installing treesitter build backend failed\n' .. result.stderr, vim.log.levels.ERROR)
end
end,
}, },
--- diff view --- --- diff view ---