10 votes

Highlighting code with color can carry a huge amount of information, and there are many useful approaches other than just using it for syntax

4 comments

  1. undu
    Link
    I agree with author that regex-based syntax highlighting is not a good solution, I disagree that syntactic highlight is a waste of time as the two are not the same. tree-sitter has been adopted by...

    I agree with author that regex-based syntax highlighting is not a good solution, I disagree that syntactic highlight is a waste of time as the two are not the same.

    tree-sitter has been adopted by github to provide grammar-based code highlighting https://github.blog/2018-10-31-atoms-new-parsing-system/ and code search https://docs.github.com/en/github/managing-files-in-a-repository/navigating-code-on-github

    It's being integrated into other editors a plugins: https://marketplace.visualstudio.com/items?itemName=georgewfraser.vscode-tree-sitter
    https://github.com/nvim-treesitter/nvim-treesitter and even integrated into the core of neovim: https://github.com/neovim/neovim/issues/11724
    I hope that tree-sitter and LSP can cover a good part of the editor / language matrix and reduce a lot of the ad-hoc tools that exist in this space right now.

    4 votes
  2. acdw
    Link
    I just want to comment and thank OP for retitling this article -- when I saw it on HN I thought it meant something very different (what exactly, I couldn't tell you, but "information channel" is...

    I just want to comment and thank OP for retitling this article -- when I saw it on HN I thought it meant something very different (what exactly, I couldn't tell you, but "information channel" is an obtuse way to put it, I think).

    4 votes
  3. teaearlgraycold
    Link
    Here’s a wild idea. What if we desaturated, or even completely removed syntax highlighting from, lines of code without test coverage. Coverage reports already make this information easy to overlay...

    Here’s a wild idea. What if we desaturated, or even completely removed syntax highlighting from, lines of code without test coverage. Coverage reports already make this information easy to overlay with your source code.

    3 votes
  4. Eabryt
    Link
    I don't totally understand the obsession with more colours. I do think there are advantages, and something like the rainbow & context highlighting look interesting, but the rest of the suggestions...

    I don't totally understand the obsession with more colours.

    I do think there are advantages, and something like the rainbow & context highlighting look interesting, but the rest of the suggestions listed here just look like they would clutter everything up and make it way more difficult to understand what you're looking at.