uartois/sonar-golang

Highlighting problem on save

timestee opened this issue · 2 comments

SonarQube Version 6.5 (build 27846) and sonar-golang Version 1.2.11-rc2.

java.lang.IllegalStateException: Cannot register highlighting rule for characters at Range[from [line=225, lineOffset=13] to [line=225, lineOffset=19]] as it overlaps at least one existing rule
	at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.checkOverlappingBoudaries(DefaultHighlighting.java:60)
	at org.sonar.api.batch.sensor.highlighting.internal.DefaultHighlighting.doSave(DefaultHighlighting.java:120)
	at org.sonar.api.batch.sensor.internal.DefaultStorable.save(DefaultStorable.java:45)
	at fr.univartois.sonargo.highlighter.Colorizer.colorize(Colorizer.java:48)
	at fr.univartois.sonargo.highlighter.HighlighterSensor.lambda$execute$1(HighlighterSensor.java:42)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at fr.univartois.sonargo.highlighter.HighlighterSensor.execute(HighlighterSensor.java:42)
	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:179)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:261)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:256)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:245)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:119)
	at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
	at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
	at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
	at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
	at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
	at org.sonar.runner.api.Runner.execute(Runner.java:100)
	at org.sonar.runner.Main.executeTask(Main.java:70)
	at org.sonar.runner.Main.execute(Main.java:59)
	at org.sonar.runner.Main.main(Main.java:53)

Hi,
Thanks for your feedback. You have an exception but the running finish and you have the informations of analyse in dashboard, no ?

This problem is same of #15. The solution is to create all grammar of Golang for the plugin, this is a feature for the next release 2.0 (see #20).

Duplicate of #15