mathiasfrohlich / vscode-kotlin

Kotlin language support for VS Code
Apache License 2.0
201 stars 21 forks source link

Syntax highlighting breaks after < and <= operators #31

Closed tormol closed 4 years ago

tormol commented 5 years ago

1 28 1 screenshot

code

vscode version: 1.28.1 built from source kotlin-language version: 1.7.0 (from marketplace) OS: Ubuntu 18.04

mondique commented 5 years ago

It seems that it thinks that < is the beginning of a scope (an opening brace). As you can see, it highlights the text after > and the original < is highlighted as the corresponding brace for the > sign. (And by the way, the closing > sign was not shifted by me - I typed it at the beginning of the line - it was probably aligned with the line 2 containing "<")

vscode version: 1.29.1 Kotlin Language version: 1.7.0 (from marketplace) OS: Windows 10 Pro version 1803

capture

valen214 commented 5 years ago

/syntaxes/Kotlin.tmLanguage: line 829 suggests the cause is '<' being captured as generic.begin

wildlava commented 5 years ago

I can verify that temporarily changing the symbols for "<" and ">" on lines 831 and 841 of Kotlin.tmLanguage causes the problem to go away. It might work, therefore, just to remove the detection of the generic begin/end chars (at least as a stop-gap solution). But I am not sure of the exact changes to this file that would be required to do that.

Mithrandir2k18 commented 4 years ago

Issue still present, check out this file, commit d2e703c, line 63

Kotlin v1.7.0 Windows 10 1709, 16299.1625 Code v 1.42.0