Conversation
| name: 'storage.modifier.other' | ||
| }, | ||
| { | ||
| match: '(?<=^|\\s)\\b(into)\\b(?=[a-z\\s]*\\b(type|class|trait|enum)\\b)', |
There was a problem hiding this comment.
Consider adding it to the list above with transparent, infix, etc. Before a def, it's still considered as the keyword, but it's invalid there. Same as open for example.
There was a problem hiding this comment.
Ach right, I just figured we shouldn't show soft keywords as keywords in invalid scenarios.
There was a problem hiding this comment.
but make sense to follow the same rules as before
There was a problem hiding this comment.
Ach right, I just figured we shouldn't show soft keywords as keywords in invalid scenarios.
Yes, we should, actually. If they are in a position where they are treated as keywords, they should be shown as keywords. Whether it's valid in the specific context is not a highlighter concern, it's a parser/checker concern.
It would be more disturbing to see into displayed as regular identifier, but then have the compiler tell you "values cannot be into" (as it does).
https://docs.scala-lang.org/sips/71.html