haxe-checkstyle icon indicating copy to clipboard operation
haxe-checkstyle copied to clipboard

WhitespaceAround fails with special characters in comment

Open Gama11 opened this issue 8 years ago • 6 comments

class Test {
    // °
    var test:Int = 0;
}
./source/Test.hx:4: characters 16-17 : Error: No whitespace around "="

Same result with ä or ß and probably tons of other slightly non-standard characters.

I think this didn't cause issues not too long ago...

Gama11 avatar Mar 04 '16 17:03 Gama11

Can't seem to reproduce this anymore.. Might've been an old hxparse version.

Gama11 avatar Mar 04 '16 22:03 Gama11

This fails on python (I've been playing around with checkstyle on the python and lua targets. Don't think there's any real use-case for that, but I found a few Haxe bugs that way at least).

Gama11 avatar Apr 05 '16 20:04 Gama11

I just had the same problem when using vscode-checkstyle on a file with a comment that contained an umlaut. The same file runs fine on Neko and C++ builds of checkstyle.

I don't have a JS build set up, so I cannot debug it right now, but I guess the positions for tokens are off because of utf-8 / unicode encoding. So certain checks find violations because they look at the wrong position in the file.

We also might have to get the unittests to run on JS to make sure it runs properly in vscode.

AlexHaxe avatar Apr 30 '18 22:04 AlexHaxe

I changed content from String to Bytes, so now positions should be correct. At least my tests in vscode showed no more checkstyle issues with lines containing umlaut or other utf-8 characters.

AlexHaxe avatar May 01 '18 15:05 AlexHaxe

~~hmmm... it works on Linux, but not on Windows~~ edit: it works on Windows, I had my haxelib setup mixed up, so vscode-checkstyle was using release version 2.2.1 instead of latest dev.

AlexHaxe avatar May 01 '18 21:05 AlexHaxe

I haven't really checked, but I also haven't seen any issues with vscode-checkstyle, is it still broken?

AlexHaxe avatar Dec 01 '19 11:12 AlexHaxe