helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.18k stars 2.46k forks source link

Syntax highlighting for .tera #6277

Open Scripter17 opened 1 year ago

Scripter17 commented 1 year ago

Template engines like Tera are a way of doing server side rendering by having a template and then inserting data when the page is loaded

The main issue, once you've solved how to treat .html.tera and .css.tera differently, is that syntax highlighting for tera probably requires having a second copy of every relevant language's syntax highlighting code with tera's preprocessing syntax crammed in. Which is at best a pain and at worst not possible. Though I doubt many people need tera support for anything other than html, css, and json

Honestly I don't expect this to happen any time soon. I'm mainly making this issue because I didn't find a previous issue on this and whatever conversation happens here will probably be helpful to anyone else looking into this type of thing

the-mikedavis commented 1 year ago

Also see https://github.com/helix-editor/helix/pull/3323

Templating languages like jinja2 or ejs/erb are possible to support through tree-sitter injections. There isn't currently a way to embed the surrounding language based on the file-type though (HTML for .html.j2 / CSS for .css.j2)

FantasyPvP commented 7 months ago

+1 currently working on a project that requires the use of .tera files (a site that uses a rocket webserver) and helix syntax highlighting would make life so much easier