Context
Part of the 🛠 Developer experience EPIC #77, targeting v1.7.0.
Goal
Extend the regex-based syntax highlighter (src/render/highlight.ts) with five new language profiles. The existing pattern is trivially extensible — each language just needs a new entry in detectLang and a new tokenRules entry.
Languages to add
| Language |
Extensions |
Key tokens |
| PHP |
.php, .phtml |
Keywords (function, class, echo…), $variables, strings, comments (//, #, /* */) |
| C/C++ |
.c, .h, .cpp, .cc, .cxx, .hpp, .hxx |
Keywords (int, void, struct…), preprocessor (#include, #define), strings, comments |
| Swift |
.swift |
Keywords (var, let, func, class, guard…), strings, comments |
| Terraform / HCL |
.tf, .hcl |
Block keywords (resource, variable, output, module), booleans, strings, # comments |
| Dockerfile |
Filenames matching Dockerfile, dockerfile |
Instructions (FROM, RUN, CMD, EXPOSE, ENV…), comments |
Acceptance criteria
Context
Part of the 🛠 Developer experience EPIC #77, targeting v1.7.0.
Goal
Extend the regex-based syntax highlighter (
src/render/highlight.ts) with five new language profiles. The existing pattern is trivially extensible — each language just needs a new entry indetectLangand a newtokenRulesentry.Languages to add
.php,.phtmlfunction,class,echo…),$variables, strings, comments (//,#,/* */).c,.h,.cpp,.cc,.cxx,.hpp,.hxxint,void,struct…), preprocessor (#include,#define), strings, comments.swiftvar,let,func,class,guard…), strings, comments.tf,.hclresource,variable,output,module), booleans, strings,#commentsDockerfile,dockerfileFROM,RUN,CMD,EXPOSE,ENV…), commentsAcceptance criteria
detectLangpath (extension → tokenizer)