Agentfly

Languages

Tree-sitter highlighting

Languages · 1 min read

Colours the code by properly reading it, rather than by pattern-matching the words - so the colours are right even in tricky code.

When you would want it

Simple colouring gets confused by things like a keyword inside a string, or nested templates. Real parsing does not get confused.

Where to find it

  • All Features → Tree-sitter highlighting
  • Turn on or off
  • Settings

What you get out of it

  • Keywords inside strings, nested templates, and other tricky spots colour correctly.
  • The same parse tree powers outline and folding, so everything agrees about the structure.

How to use it, step by step

  1. On by default - nothing to install.
  2. Open a file; Agentfly loads that language's grammar the first time it is needed.
  3. If a grammar ever fails to load, highlighting falls back to the simpler method rather than turning off.

Why this beats the usual way

Regex highlighting gets confused exactly where code gets interesting. Real parsing means the colours describe the program, not the spelling of the words.

Find it in Universal Search

Tree-sitter highlighting · Languages