Hacker News new | ask | show | jobs
by ajanuary 245 days ago
They’re not talking about the squiggly line. The word return/retunr gets highlighted in slightly different colors based on whether the highlighter is picking it up as a keyword or a variable name, but in the scheme the colors are similar.
2 comments

But their argument is based on the underlying assumption that it's the responsibility of the syntax highlighter to tell you when you've made a typo.

I am presenting an argument against this - and stating it's the responsibility of _diagnostics_ to tell you when you've made a typo, not syntax highlighting.

I would add that no highlighting would be applied to this mistyped word as it would not be recognised as a variable or a keyword. This may depend on the way syntax highlighting is handled. A common solution like treesitter would sus out that no variable with the name retunr exists, probably causing the mythical base colour to be applied, heh. That is arguably a big highlight in a colourscheme that rarely uses its base colour.