tree-sitter-http
tree-sitter-http copied to clipboard
HTTP grammar for tree-sitter
When attempting to run the below request... ```http GET https://reqres.in/api/users?page=5 Accept: application/json;v=2 ``` ...I get the following error: ``` [rest.nvim] ERROR: The tree-sitter node at the range [0:0 - 1:28]...
I'm getting an error when trying to use `=` inside my `Authorisation` value. For example, using; ``` Authorisation: Basic YmQ0NT02NTM4YWE5ND03MzJkMTdlN0RiNTdkOGFj0TAwZjhkZj0mYTp5Qzc4aDgmZW85R1A= ``` results in: ``` Error executing Lua callback: .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: attempt...
The `{{TOKEN}}` in this case, is parsed as `value`, instead of `variable`. The header should be parsed to ``` header name: name value: value value: value value: variable name: identifier...
I noticed there was no formatter specified, so I took inspiration from the rest.nvim repo and added a similar workflow for formatting the grammar.
It would be neat if I could divide a JSON variable into multiple lines. The following request ```sh @value = { "foo": 1, "bar": 2 } POST http://localhost {{value}} ```...

Is there a way to let query strings more human-readable as this vscode extension does? https://marketplace.visualstudio.com/items?itemName=humao.rest-client
Using this page https://meimporta.eu/tree-sitter/json2ebnf.html we can get a navigable railroad diagram for tree-sitter grammars like this project. See also https://github.com/tree-sitter/tree-sitter/issues/2268 . Cheers !
so that one can build the grammar via just `nix build` WIP