{"action":"created","issue":{"url":"https://api.github.com/repos/SonarCommunity/sonar-css/issues/147","labels_url":"https://api.github.com/repos/SonarCommunity/sonar-css/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/SonarCommunity/sonar-css/issues/147/comments","events_url":"https://api.github.com/repos/SonarCommunity/sonar-css/issues/147/events","html_url":"https://github.com/SonarCommunity/sonar-css/issues/147","id":116053795,"number":147,"title":"Files ending with a comment fail to highlight in SQ 5.2 and fail overall analysis","user":{"login":"dbolkensteyn","id":1132601,"avatar_url":"https://avatars.githubusercontent.com/u/1132601?v=3","gravatar_id":"","url":"https://api.github.com/users/dbolkensteyn","html_url":"https://github.com/dbolkensteyn","followers_url":"https://api.github.com/users/dbolkensteyn/followers","following_url":"https://api.github.com/users/dbolkensteyn/following{/other_user}","gists_url":"https://api.github.com/users/dbolkensteyn/gists{/gist_id}","starred_url":"https://api.github.com/users/dbolkensteyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbolkensteyn/subscriptions","organizations_url":"https://api.github.com/users/dbolkensteyn/orgs","repos_url":"https://api.github.com/users/dbolkensteyn/repos","events_url":"https://api.github.com/users/dbolkensteyn/events{/privacy}","received_events_url":"https://api.github.com/users/dbolkensteyn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SonarCommunity/sonar-css/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"racodond","id":1215713,"avatar_url":"https://avatars.githubusercontent.com/u/1215713?v=3","gravatar_id":"","url":"https://api.github.com/users/racodond","html_url":"https://github.com/racodond","followers_url":"https://api.github.com/users/racodond/followers","following_url":"https://api.github.com/users/racodond/following{/other_user}","gists_url":"https://api.github.com/users/racodond/gists{/gist_id}","starred_url":"https://api.github.com/users/racodond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racodond/subscriptions","organizations_url":"https://api.github.com/users/racodond/orgs","repos_url":"https://api.github.com/users/racodond/repos","events_url":"https://api.github.com/users/racodond/events{/privacy}","received_events_url":"https://api.github.com/users/racodond/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SonarCommunity/sonar-css/milestones/4","html_url":"https://github.com/SonarCommunity/sonar-css/milestones/1.6","labels_url":"https://api.github.com/repos/SonarCommunity/sonar-css/milestones/4/labels","id":1313192,"number":4,"title":"1.6","description":"","creator":{"login":"racodond","id":1215713,"avatar_url":"https://avatars.githubusercontent.com/u/1215713?v=3","gravatar_id":"","url":"https://api.github.com/users/racodond","html_url":"https://github.com/racodond","followers_url":"https://api.github.com/users/racodond/followers","following_url":"https://api.github.com/users/racodond/following{/other_user}","gists_url":"https://api.github.com/users/racodond/gists{/gist_id}","starred_url":"https://api.github.com/users/racodond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racodond/subscriptions","organizations_url":"https://api.github.com/users/racodond/orgs","repos_url":"https://api.github.com/users/racodond/repos","events_url":"https://api.github.com/users/racodond/events{/privacy}","received_events_url":"https://api.github.com/users/racodond/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2015-09-18T11:45:07Z","updated_at":"2015-11-10T07:35:35Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-11-10T07:35:35Z","updated_at":"2015-11-10T15:22:47Z","closed_at":null,"body":"If a file ends with a comment, the CSS highlighting fails in SonarQube 5.2, which in turns fails the overall anaylsis:\r\n\r\n```\r\nbody {}\r\n/*foo*/\r\n```\r\n\r\nwill lead to the following error:\r\n\r\n```\r\nINFO: ------------------------------------------------------------------------\r\nINFO: EXECUTION FAILURE\r\nINFO: ------------------------------------------------------------------------\r\nTotal time: 2.522s\r\nFinal Memory: 11M/322M\r\nINFO: ------------------------------------------------------------------------\r\nERROR: Error during Sonar runner execution\r\nERROR: Unable to execute Sonar\r\nERROR: Caused by: Unable to analyze file: C:\\Users\\dinesh\\Desktop\\sonarsource\\sonar-examples\\projects\\languages\\css\\css-sonar-runner\\src\\Site.css\r\nERROR: Caused by: Unable to highlight file [moduleKey=org.sonarqube:css-simple-sq-runner, relative=src/Site.css, basedir=C:\\Users\\dinesh\\Desktop\\sonarsource\\sonar-examples\\projects\\languages\\css\\css-sonar-runner] from offset 12 to offset 19\r\n\r\nERROR: Caused by: 19 is not a valid offset for file [moduleKey=org.sonarqube:css-simple-sq-runner, relative=src/Site.css, basedir=C:\\Users\\dinesh\\Desktop\\sonarsource\\sonar-examples\\projects\\languages\\css\\css-sonar-runner]. Max offset is 18\r\n```\r\n\r\nThis bug was initially reported on StackOverflow: http://stackoverflow.com/questions/33551357/5-2-upgrade-illegalargumentexception-unable-to-highlight-file"},"comment":{"url":"https://api.github.com/repos/SonarCommunity/sonar-css/issues/comments/155450005","html_url":"https://github.com/SonarCommunity/sonar-css/issues/147#issuecomment-155450005","issue_url":"https://api.github.com/repos/SonarCommunity/sonar-css/issues/147","id":155450005,"user":{"login":"racodond","id":1215713,"avatar_url":"https://avatars.githubusercontent.com/u/1215713?v=3","gravatar_id":"","url":"https://api.github.com/users/racodond","html_url":"https://github.com/racodond","followers_url":"https://api.github.com/users/racodond/followers","following_url":"https://api.github.com/users/racodond/following{/other_user}","gists_url":"https://api.github.com/users/racodond/gists{/gist_id}","starred_url":"https://api.github.com/users/racodond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racodond/subscriptions","organizations_url":"https://api.github.com/users/racodond/orgs","repos_url":"https://api.github.com/users/racodond/repos","events_url":"https://api.github.com/users/racodond/events{/privacy}","received_events_url":"https://api.github.com/users/racodond/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T15:22:47Z","updated_at":"2015-11-10T15:22:47Z","body":"> Strange.. here's the file (rename it in .css) Site.txt\r\n\r\nThe analysis succeeds on Linux. But the syntax highlighting is not perfect due to the presence of the BOM. The presence of the BOM might lead to some issues because it corrupts the syntax highlighting position the way it is currently code. See the thread I opened today about this topic:  https://groups.google.com/d/msg/sonarqube/u98klcXNGA0/lq1qOloLCAAJ. All the plugins seem to face the same issue with the BOM file. So, it could be nice if somebody at SonarSource could answer the thread to explain how they plan to deal with BOM in syntax highlighting.\r\n\r\nThanks\r\n\r\nDavid\r\n\r\n"}}