Closed wildlava closed 4 years ago
Hi, just wondering if anyone has had a chance to look at this. It looks like there has not been a lot of activity lately... I'd love to get this into the repo, esp. if it will improve things. Thanks!
Thanks for your contribution - I'll take a look a this
A workaround until this is merged is to replace the file .vscode\extensions\mathiasfrohlich.kotlin-1.7.0\syntaxes\Kotlin.tmLanguage
with the file from this PR. That folder can be found in your $HOME
or %USERPROFILE%
folder.
A workaround until this is merged is to replace the file
.vscode\extensions\mathiasfrohlich.kotlin-1.7.0\syntaxes\Kotlin.tmLanguage
with the file from this PR. That folder can be found in your$HOME
or%USERPROFILE%
folder.
Thanks! Yep, I did something similar when I was testing my changes. Hopefully this will get merged (or if not completely correct that an even better fix can be made).
Thanks for your contribution on this issue.
Can you please release this fix as patch version 1.7.1? The < operator breaking synthax highlighting for the entire rest of a file seems to be a pressing enough issue to warrant a timely release.
cc @mathiasfrohlich ^
It is now Live Thanks for the contribution
The issue is that the highlighting code cannot determine if a "<" character is a "less than" operator or the start of a generic type parameter section. So, currently, when "<" is seen, all code after it is highlighted as if it were in a generic type parameter section. The code that handles this only highlights "out" and "in" keywords and includes "#types".
The fix I am proposing is to remove the generic type parameter section code and add "out" and "in" to the storage.modifier.kotlin keyword list.
If proper syntax is used in a generic type parameter section, the highlighting should be correct (but non-relevant syntax will be highlighted, too). Also, "out" and "in" will be highlighted even if outside such a section. But there are other things like this that happen with the existing code, like highlighting "protected" as a keyword even if used as a variable name, which is valid syntax.
This may be the best we can do using TextMate. It certainly is better than what happens when this issue is triggered.