📝Code highlighting can carry more information

source
Syntax highlighting is a waste of an information channel

Code is a huge channel for helping people understand information, draw attention, etc.

Currently, code highlighting is only used to highlight syntax. Which doesn’t carry much information. (I believe highlighting keywords only would usually be enough.)

However, there are a lot more things that could leverage a color.

Examples:

  • types (all variables of the same type would be of the same color)
  • locals (local variables/function arguments are highlighted)
  • tests (highlight functions that were called in the failed test)
  • version control (highlight code that was introduced by team member)
  • exceptions (highlight functions that throw exceptions)
  • effects (highlight functions that do specific effects IO/etc)

These are much harder than usual syntax highlighting (which can be usually done with simple regex).

Projectional Editors can do these easier as they have access to the AST.

Backlinks