-
-
Notifications
You must be signed in to change notification settings - Fork 147
New requests added to http file are not detected until reload #508
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
Comments
You mean that rest.nvim can't detect the file update outside of neovim? |
No, I mean inside of neovim. Changes to existing requests are read correctly. But adding new requests into an http file, without reloading the file, has rest.nvim not detect the newly added request until reloading/reopening the file. |
That's weird. My usual workflow is to open a http file, write new request, run it and delete it and it totally works fine. I think you are writing wrong syntax or there is a parser bug. Can you try with these steps?
|
rest.nvim.movI have created a small video here to showcase the issue.
|
rest.nvim.movHere is another video showing adding a new request. Again, it is only correctly detected after file save + reload/reopen |
That's strange. Maybe tree-sitter parser is not attached to the buffer before reloading..? Can you reproduce it with minimal config above? Save this code as vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
"rest-nvim/rest.nvim",
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
main = "nvim-treesitter.configs",
opts = {
ensure_installed = { "http" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
},
},
},
}) |
It works fine with that minimal repro config. |
I'm pretty sure that this is tree-sitter configuration issue but can't really tell without your config. It seems you don't have any highlights in http file format. You try these steps:
If running vim.api.nvim_create_autocmd("FileType", {
pattern = "http",
callback = function(ev)
vim.treesitter.start(ev.buf, "http")
end,
}) Please tell me if this fix your issue! Edit: done |
Thank you very much @boltlessengineer for the support and time investigating this issue for me, this did in fact fix the problem! |
Prerequisites
Neovim Version
v0.10.3
Operating system/version
macOS 15.2
Actual behavior
rest.nvim does not detect new requests added to an http file. It only detects requests that were present when the file was opened, therefore, when adding a new request to a new file or an existing http file, one has to manually reload it before executing new requests.
Expected behavior
rest.nvim should detect new requests added to http files before trying to find them in the file.
Steps to reproduce
Rest run
:e!
to reload the fileRest run
Other information
No response
Repro (
lazy.nvim
)The text was updated successfully, but these errors were encountered: