Skip to content

feat: Add syntax highlighting configuration

Administrator requested to merge tjdevries/syntax_highlighting_site_config into main

Created by: tjdevries

Adds the ability to easily map (at a site setting level) different extensions and patterns to other filetypes.

Examples below with strato

image

Example config:

  "highlights": {
    "engine": {
        "default": "tree-sitter",
        "overrides": {
            "C#": "tree-sitter"
        }
    },
    "filetypes": {
      "extensions": {
        "strato": "scala"
      },
      "patterns": []
    }
  },

Status

  • highlights.filetypes.extensions works, so you could test that out if you want.
  • highlights.filetypes.patterns works. Test with different ordering
  • Can use engine configuration to change which highlighter will work
  • Update logging to make sure we note which engine is doing the work
  • Mark experimental feature unused
  • Write documentation for languages supported
  • Add information to release notes

Test plan

  • Try different combinations of extensions and patterns, as well as default engine.

Related Issues:

Merge request reports

Loading