Orange-OpenSource / hurl

Hurl, run and test HTTP requests with plain text.
https://hurl.dev
Apache License 2.0
12.98k stars 486 forks source link

Syntax highlighting plugin for editor #983

Open manuwell opened 1 year ago

manuwell commented 1 year ago

Hey guys, do you know if is there some plugin with syntax highlighting for hurl lang?

I am a vim user, and didn't found anything. Even vscode doesn't have a plugin. What you use to syntax highlighting .hurl files?

jcamiel commented 1 year ago

Hi,

Unfortunately, Hurl tooling support needs more work now. There is some very basic syntax highlighting files for vim and Jetbrain's IDEs here: https://github.com/Orange-OpenSource/hurl/tree/master/contrib.

We know we need to work on it (for VSCode for instance) external contributions are welcome of course!

manuwell commented 1 year ago

You are all great. I'll see if I can help with something.

thanks a lot \o/

didier-contribs commented 1 year ago

I found minutes ago https://github.com/fourjay/vim-hurl, very nice syntax highlighter for vim

jcamiel commented 1 year ago

@didier-contribs Yes, you can try (and improve!) also this one https://github.com/Orange-OpenSource/hurl/tree/master/contrib/vim

pfeiferj commented 1 year ago

I just created a tree-sitter parser for the file format, it should be pretty accurate. I followed the grammar file pretty closely, but there could be some mistakes from not understanding the nuances of tree-sitter and/or bad find and replace. https://github.com/pfeiferj/tree-sitter-hurl

pfeiferj commented 1 year ago

Screenshot from 2022-12-21 01-54-33 Here's a screenshot of the tree-sitter parser highlighting in my neovim instance

pfeiferj commented 1 year ago

Screenshot from 2022-12-22 17-30-04 Getting some promising results from using the tree-sitter parser in a vs-code extension as a semantic token lsp provider, may be able to publish it soon

pfeiferj commented 1 year ago

published the vs-code extension: https://marketplace.visualstudio.com/items?itemName=JacobPfeifer.pfeifer-hurl

jcamiel commented 1 year ago

Extra work @pfeiferj! Do you have any git repo for this if we want to contribute (when there is slight grammar modification)? Many thanks for this!

pfeiferj commented 1 year ago

The plugin uses the tree-sitter parser, so two separate repos So the grammar is in: https://github.com/pfeiferj/tree-sitter-hurl The plugin is: https://github.com/pfeiferj/vscode-hurl

pfeiferj commented 1 year ago

i've also got a neovim plugin going, although people can use the tree-sitter-parser in neovim without the plugin, just makes it a little easier. https://github.com/pfeiferj/nvim-hurl

jellydn commented 1 week ago

Hey everyone,

I’ve created two new tools to enhance your Hurl experience:

  1. Neovim Plugin: jellydn/hurl.nvim
  2. VS Code Extension: jellydn/vscode-hurl-runner

Check them out and let me know what you think! Your feedback and suggestions are welcome.

Cheers,

pfeiferj commented 1 week ago

Hey everyone,

I’ve created two new tools to enhance your Hurl experience:

  1. Neovim Plugin: jellydn/hurl.nvim
  2. VS Code Extension: jellydn/vscode-hurl-runner

Check them out and let me know what you think! Your feedback and suggestions are welcome.

Cheers,

Neat, I’ve more or less deprecated my neovim plugin, I’ve gotten my treesitter implementation into nvim-treesitter and I never really got a good runner going in my plugin, so I’ll definitely point people to your plugin over there. Kinda in the same place with my vscode plugin, I’ll probably deprecate the runner in my vscode plugin and point towards yours. I don’t currently use hurl for my job so my maintanence has been a bit slow on my plugins. I’ll have to test out the highlighting on your vscode plugin, not sure how well the regex highlighting performs vs the treesitter lsp highlighting. Ideally I wouldn’t mind deprecating my entire plugin in favor of one with a more active maintainer, and the highlighting would be the only thing that might prevent me from doing so

jellydn commented 1 week ago

Great. Thanks @pfeiferj

I’ll have to test out the highlighting on your vscode plugin, not sure how well the regex highlighting performs vs the treesitter lsp highlighting

Your treesitter plugin is better than my VS Code plugin however I believe the hurl syntax is lightweight. I tried to use web-tree-sitter but doesn't work with the latest treesitter version so I chose the current approach.

pfeiferj commented 1 week ago

Your treesitter plugin is better than my VS Code plugin however I believe the hurl syntax is lightweight. I tried to use web-tree-sitter but doesn't work with the latest treesitter version so I chose the current approach.

Gotcha, I'll just update mine to only focus on syntax highlighting and make it clear that additional functionality can be added with other extensions.