mistweaverco / kulala.nvim

A minimal 🤏 HTTP-client 🐼 interface 🖥️ for Neovim ❤️.
https://kulala.mwco.app
MIT License
304 stars 5 forks source link

Complete rewrite of the Kulala HTTP-Requests-Parser #18

Closed gorillamoe closed 1 week ago

gorillamoe commented 3 weeks ago

The current version relies almost entirely on the Treesitter HTTP Grammar, which does not really well conform to the HTTP file spec. It does work well enough for the current version, but I don't see it working well for us with the features that are planned.

Therefore I'm working on a complete rewrite of the parser.

This blocks #4, but I can't reliable add piping of commands, if the grammars errors that often. That's not a good UX and won't help the project.

I thought about forking the TS HTTP project and asking @teej_dv about getting it into Neovim, but that would block the ongoing rework of Kulala quite a bit and also I'm a treesitter grammar noob.

If someone is willing to fix the grammar and maintain it, I'm happy to go for TS again, but as long as the grammar is not stable, I'm going for a custom parser.

That would take a hit on the performance, I know, but we're talking milliseconds here, because of how powerful computers are these days. So don't come up with that argument, please. If you are afraid of performance, go ahead and fork the grammar and fix it, please <3

For those wondering on what is broken with the grammar, mostly it is the parsing of the

METHOD URL HTTP_VERSION line and the headers.

Once the grammar throws, it will swallow the error'd value or the root node, causing some http headers simply to disappear :see_no_evil:

vhespanha commented 2 weeks ago

Hey, i would like to help if this too if possible

gorillamoe commented 2 weeks ago

Hey @vhespanha, you could be of great help when it comes to testing. It's quite a large rewrite and I fear that we could break a lot of things with it. So testing, when the first pre-release version is ready, would help immensely!