Hugo tree-sitter library/"""language server"""

Hello. Sorry in advance if I put this OP in wrong category, I’m not 100% sure that fits support or somewhere else.

Recently I tried to move from VSCode to another IDEs, because I want to experience different thing, I like alternatives and etc. etc… Also I’m creating a website in hugo, because I want to create something by my own, but it keeps automatic things that’s annoying.

The problem is different IDEs are not using VSCode structure, and are poorer in content, including extensions. However, I would like it to be possible to use hugo pleasantly and with simplicity, outside of using vscode. And I found something that might help with creating thing in hugo, and the program calls tree-sitter.

What’s tree-sitter

As the creators describe themselves: “tree-sitter is a parser generator tool and an incremental parsing library”. It can create syntax for most of programing language, it’s written in C; and it’s currently using in NeoVim, Pulsar (fork of Atom), Zed, Emacs, Github and some more.

Current situation of creating hugo tree-sitter lib

As for now, tree-sitter for hugo is not made, and even no mentions, besides of this post on this forum by ahelwer. But he is inactive since Feb 2023, but I found email to him, so I could try to write to him.

I tried to find references related to pseudo-language on GitHub and tree-sitter and I found for django which use some double braces ( {{}} ). Also I tried to look to VSCodes plugin like: GitHub - theNewDynamic/language-hugo-vscode: Adds syntax highlighting to Hugo files in VS Code and it’s inspiration from plugin from atom: GitHub - mattstratton/language-hugo: Hugo syntax highlighting in Atom, was helpful, but it’s not as simple as pressing ctrlC, ctrlV.

Even I tried myself doing it, by forking the html and adding highlighting braces (without thing that is inside. And as I expected for person with no knowledge in programing (I don’t count html and css) I have achieve nothing, and I’m not even sure to show it, cause it would make you headache. That’s why I would need someone’s help or even make it for me to build it.

I hope that this textual gibberish may have interested someone to review and be interested towards this library and that one day you will see plugins for such IDEs

Just small update: I found another tree-sitter that can be use for hugo because it’s go template tree: link to the repo. But, there some cones:

  • project is not maintained anymore,
  • it only supports ‘gotmpl’ file extension, so there is the possibility of merging with html/markdown, but this is easier said than done.

But there’s something nonetheless.