rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.52k stars 141 forks source link

V2.0 not running asynchronously #357

Closed kevintraver closed 1 month ago

kevintraver commented 5 months ago

When using the latest version (2.0), neovim completely locks up until the request has finished:

GET https://httpbin.org/delay/10

Config:

MacOS : 14.4.1 Neovim: 0.9.5 LuaJIT: 2.1.1710088188

init.lua:

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  {
    "vhyrro/luarocks.nvim",
    priority = 1000,
    config = true,
  },
  {
    "nvim-treesitter/nvim-treesitter",
    config = true,
    build = ":TSUpdate",
  },
  {
    "rest-nvim/rest.nvim",
    ft = "http",
    tag = "v2.0.1",
    dependencies = { "luarocks.nvim", "nvim-treesitter" },
    config = function()
      require("rest-nvim").setup()
    end,
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
NTBBloodbath commented 5 months ago

Hi, is nvim-nio installed? Please send the output of :checkhealth rest-nvim as well and I'll take a look at it asap :)

kevintraver commented 5 months ago
Installation
- OK Found `luarocks` installed in your system
- OK Found Luarocks PATHs in your Neovim's Lua `package.path`
- OK Dependency `nvim-treesitter` was found
- OK Dependency `lua-curl` was found
- OK Dependency `nvim-nio` was found
- OK Dependency `xml2lua` was found
- OK Dependency `mimetypes` was found
- OK Tree-sitter `http` parser is installed

Configuration ~
- OK No unrecognized configuration options were found
- OK Formatter for `json` is set to `jq` and rest.nvim found it in your system
- OK Formatter for `html` is set to `tidy` and rest.nvim found it in your system
kevintraver commented 5 months ago

I also tested the latest version of Neovim v0.10.0-dev-2893+g328a23735-Homebrew but still encounter the same issue.

daniilrozanov commented 4 months ago

Same thing happens for me. :checkhealth rest-nvim is ok, latest v0.10... neovim. Queries that take long time freeze neovim

egihasdi commented 4 months ago

Hi, thank you for this great plugin and the latest update is awesome. I experienced it too while running a Go debugger. When it hits breakpoint it freezes and I can't do anything other than force close the terminal. Have tried to open on separate terminal, it also freezes until I continue the debug breakpoint.

boltlessengineer commented 1 month ago

Closing this due to v3 release. Now as we don't use lib-curl but instead run native curl with vim.system(). This makes rest.nvim truely asynchronous and it won't block your editor any more.