lf-lang / vscode-lingua-franca

Lingua Franca extension for Visual Studio Code
Other
4 stars 3 forks source link

Do not highlight whitespace #118

Closed petervdonovan closed 1 year ago

petervdonovan commented 1 year ago

Recently I wrote:

I think that most of the changes in the "known good" files come from tokenizing whitespace, which seems entirely harmless.

This is untrue. We should not tokenize whitespace, as was done in #111.

This is because although whitespace is not colored in VS code, if you use a theme such as Abyss or Monokai which uses underlines, the whitespace will be underlined, which is not good.

We can either match a fixed amount of whitespace (which is brittle; we should probably avoid that), use programmatic highlighting instead of declarative highlighting (see highlight.ts), or do some trick with conditionally nested groups of patterns. This third option is what we do in order to apply the correct target language highlighter according to the target declaration, and I think I prefer it.

lhstrh commented 1 year ago

We should probably correct this before doing a new release. Can I help with this? I'm not sure that I understand this option 3 that you mention.

petervdonovan commented 1 year ago

Probably the most time-efficient thing would be for me to just try option 3 and see if it works at all -- I'm not sure I understand option 3, either (which makes it hard for me to explain it). I can aim to do it by Saturday.