Closed disrupted closed 1 month ago
It is not possible due to the nature of the results buffer content, at least not without introducing breaking changes and more complexity.
could you elaborate what are the breaking changes? I just tested it locally by running :set ft=http
. After making the buffer modifiable (:set modifiable
) and manually deleting the comments #+RES
and #+END
(not sure what's the purpose of those). It works well for me with a JSON body
could you elaborate what are the breaking changes? I just tested it locally by running
:set ft=http
. After making the buffer modifiable (:set modifiable
) and manually deleting the comments#+RES
and#+END
(not sure what's the purpose of those). It works well for me with a JSON body
Does the HTTP/X.X OK
line works well too? Also check :InspectTree
output to look for error nodes. If nothing is wrong, we could make the change without much problem, although I'm worried about what the parser might spit out when the response to a request is binary, or in case of returning an image
Good point, the second line gets falsely parsed as request. This would either need to be fixed in the parser, or perhaps we would need a separate parser (based on http
) since it's not part of the http filetype.
I haven't tested binary or image payload yet.
I can start by adding some test cases in https://github.com/rest-nvim/tree-sitter-http and then we can decide how to proceed, what do you think?
Sounds good to me, hope we can achieve something in the short term!
Closing this due to v3 release.
rest.nvim
now use tree-sitter-http
to highlight the result UI.
Why does the response buffer use the
httpResult
filetype, nothttp
like the request buffer? I feel like it would be nicer to use the same TreeSitter parser for the response.