-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
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
- Each new language produces ANSI-colored output (ANSI codes present in output)
- Language detection is tested via the
detectLangpath (extension → tokenizer) - Dockerfile detection works on filename, not extension
- At least one tokenizer test per language (keyword colorized, comment colorized, string colorized)
- All existing tests still pass
Reactions are currently unavailable