rest.nvim
rest.nvim copied to clipboard
New update from nvim-treesitter breaks http syntax highlight
Hi,
since this commit I encounter this error whenever I go to HTTP file
This is the minimal config to reproduce the issue:
local lazypath = vim.fn.stdpath("data") .. "/lazy/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",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
local plugins = {
{
'nvim-treesitter/nvim-treesitter',
commit = "eedc5198a1b4bb1b08ae6d4f64f3d76e376957aa", -- remove this line to cause error
build = ":TSUpdate",
opts = {
ensure_installed = { 'http' },
highlight = {
enable = true,
}
},
config = function(_, opts)
require('nvim-treesitter.configs').setup(opts)
end,
},
'NTBBloodbath/rest.nvim',
}
require("lazy").setup(plugins, {})
Here is the maintainer's suggestion:
rest.nvim
specific captures have been removed; they should be added in that plugin (as an; extends
) query. Please open an issue on that repo.
Created issue for same in here https://github.com/rest-nvim/tree-sitter-http/issues/11
Hey, I've finally managed to address this issue. See tree-sitter-http#11 comment.
Queries have been updated here too, so they will probably break if you've pinned your http tree-sitter parser using an older commit, please check it out and let me know if the issue persists.
Cheers
Hi @NTBBloodbath, thank you for the update!
For me the env variable doesn't work anymore
Hi @NTBBloodbath, thank you for the update!
For me the env variable doesn't work anymore
Hmm could you open a separate issue for this one? That way we have more organization to track latest changes bugs
I also encountered into this issue
Just updated my plugins yesterday and now I also run into this. Syntax highlighting won't work, and it even corrupts my session as soon as I enter a http file and I have to :SessionDelete. But this is a treesitter issue I believe, right?
I get error
E5108: Error executing lua ...0.9.4/share/nvim/runtime/lua/vim/treesitter/language.lua:93: no parser for 'conf' language, see :help treesitter-parsers
stack traceback:
[C]: in function 'error'
...0.9.4/share/nvim/runtime/lua/vim/treesitter/language.lua:93: in function 'add'
...4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:98: in function 'new'
...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:61: in function '_create_parser'
...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser'
...l/share/nvim/lazy/rest.nvim/lua/rest-nvim/utils/init.lua:218: in function 'read_document_variables'
...l/share/nvim/lazy/rest.nvim/lua/rest-nvim/utils/init.lua:250: in function 'read_variables'
...l/share/nvim/lazy/rest.nvim/lua/rest-nvim/utils/init.lua:260: in function 'replace_vars'
...share/nvim/lazy/rest.nvim/lua/rest-nvim/request/init.lua:253: in function 'parse_url'
...share/nvim/lazy/rest.nvim/lua/rest-nvim/request/init.lua:286: in function 'get_current_request'
.../.local/share/nvim/lazy/rest.nvim/lua/rest-nvim/init.lua:25: in function 'run'
[string ":lua"]:1: in main chunk
Structure
.rest
| .env
| dev-1.rest
I get error
E5108: Error executing lua ...0.9.4/share/nvim/runtime/lua/vim/treesitter/language.lua:93: no parser for 'conf' language, see :help treesitter-parsers stack traceback: [C]: in function 'error' ...0.9.4/share/nvim/runtime/lua/vim/treesitter/language.lua:93: in function 'add' ...4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:98: in function 'new' ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:61: in function '_create_parser' ...r/neovim/0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser' ...l/share/nvim/lazy/rest.nvim/lua/rest-nvim/utils/init.lua:218: in function 'read_document_variables' ...l/share/nvim/lazy/rest.nvim/lua/rest-nvim/utils/init.lua:250: in function 'read_variables' ...l/share/nvim/lazy/rest.nvim/lua/rest-nvim/utils/init.lua:260: in function 'replace_vars' ...share/nvim/lazy/rest.nvim/lua/rest-nvim/request/init.lua:253: in function 'parse_url' ...share/nvim/lazy/rest.nvim/lua/rest-nvim/request/init.lua:286: in function 'get_current_request' .../.local/share/nvim/lazy/rest.nvim/lua/rest-nvim/init.lua:25: in function 'run' [string ":lua"]:1: in main chunk
Structure
.rest | .env | dev-1.rest
Hey, this is odd.
- Are you using a
.http
file? - Are you lazy-loading
rest.nvim
somehow?
No lazy loading and I tried http and rest extensions, http give error http and rest give error conf
I'm pretty sure it broke on neovim 0.9.4 with this diff https://github.com/neovim/neovim/commit/c5b9643bf1b0f6d5166b4abf6a7c3f29532aefeb
Adding the http parser for treesitter fixes the issue. http parser is not enabled by default in LazyVim.
I'd suggest you check for that and if it fails just disable the .env functionality instead of erroring out?
Edit: wrapping this call in pcall will probably be enough to let it fail silently and not break the functionality: https://github.com/rest-nvim/rest.nvim/blob/84e81a19ab24ccf05c9233d34d4dfce61c233abe/lua/rest-nvim/utils/init.lua#L218
No lazy loading and I tried http and rest extensions, http give error http and rest give error conf
@volga629-1 try ensuring the http treesitter parser is installed
Thank you for reply, indeed I reinstalled plugin and make sure set
ensure_installed = {
"http",