BOM and syntax highlighting

88 views
Skip to first unread message

David Racodon

unread,
Nov 10, 2015, 6:18:23 AM11/10/15
to SonarQube
Hi,

I made my JSON plugin support UTF-8 files starting with a BOM.
After fixing the parser issue, I wanted to check how the syntax highlighter had to be updated to support files starting with a BOM.

First, I gave a try to the Java plugin but it looks like it cannot parse UTF-8 files starting with a BOM? Do you confirm?
Then, I gave a try to the JavaScript plugin but the syntax highlighter doesn't seem to properly work with files starting with a BOM:

Inline image 1


Is there any plugin properly supporting BOM for the syntax highlighter?

Thank you

Regards,


David RACODON
Freelance QA Consultant

Elena Vilchik

unread,
Nov 16, 2015, 5:32:25 AM11/16/15
to SonarQube
Hello!

About Java - javac doesn't support BOM in UTF-8 files , so there is no need to support it in our Java plugin.
For JavaScript indeed it's an issue, I've created a ticket for it SONARJS-546, probably it will be fixed by next release. 
Looks like now there are no plugins properly supporting BOM.

Thanks!

Julien HENRY

unread,
Nov 16, 2015, 5:41:41 AM11/16/15
to SonarQube
Hi,

Note that from Sensor API perspective all APIs accepting offsets as parameters consider that BOM are excluded from counting.

++

Julien
Reply all
Reply to author
Forward
0 new messages