eclipsesource / jshint-eclipse

JSHint integration for the Eclipse IDE
http://github.eclipsesource.com/jshint-eclipse/
146 stars 31 forks source link

workspace clean results in "Failed checking file ... " #60

Closed mdbarrow closed 10 years ago

mdbarrow commented 11 years ago

When "cleaning" my eclipse procect, Eclipse popup says "Problem Occurreed" with these details:

Errors occurred during the build. Errors running builder 'JSHint Problem Checker' on project 'FrontEnd'. Failed checking file /FrontEnd/js/UrlAttachments.js

When I open the JS file in eclipse, there are a small number of JsHint markers that clearly do not apply to this source file.

If I change the contents of the file (like add a bunch of newlines) and repeat, the same markers show up on the same line numbers (more proof the markers aren't associated with the file).

If I change the name of the JS file (radically different, perhaps changing the order in which the files are processed?), I see the same markers (same line numbers) on a different JS file.

I start to look for JS source file in my project to which the markers might be appropriate, but I had too many JS files to look through.

As noted, the project has lots of JS files ( maybe a couple hundred), thousands of JsHint marks (original authors of the code didn't know about JsHint/JsList), so I'm suspecting some sort of resource constraint somewhere, but I don't really want to be debugging JsHint and/or its containing Eclipse plugin if someone else might know what is happening here.

ralfstx commented 11 years ago

Could you please check the Error Log view in Eclipse for the root cause of the failure? A stack trace would be helpful. Thank you!

mdbarrow commented 11 years ago

I think this is what you are after. Thanks for your quick response.


From: Ralf Sternberg [notifications@github.com] Sent: Friday, June 28, 2013 2:07 PM To: eclipsesource/jshint-eclipse Cc: Barrow, Mike Subject: Re: [jshint-eclipse] workspace clean results in "Failed checking file ... " (#60)

Could you please check the Error Log view in Eclipse for the root cause of the failure? A stack trace would be helpful. Thank you!

— Reply to this email directly or view it on GitHubhttps://github.com/eclipsesource/jshint-eclipse/issues/60#issuecomment-20204539.

mdbarrow commented 11 years ago

java.lang.RuntimeException: Failed checking file /FrontEnd/js/UrlAttachments.js at com.eclipsesource.jshint.ui.internal.builder.JSHintBuilderVisitor.check(JSHintBuilderVisitor.java:112) at com.eclipsesource.jshint.ui.internal.builder.JSHintBuilderVisitor.visit(JSHintBuilderVisitor.java:74) at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126) at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86) at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108) at com.eclipsesource.jshint.ui.internal.builder.JSHintBuilder.fullBuild(JSHintBuilder.java:53) at com.eclipsesource.jshint.ui.internal.builder.JSHintBuilder.build(JSHintBuilder.java:34) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) Caused by: java.lang.IndexOutOfBoundsException: line does not exist: 57 at com.eclipsesource.jshint.Text.getLineOffset(Text.java:65) at com.eclipsesource.jshint.JSHint.fixPosition(JSHint.java:230) at com.eclipsesource.jshint.JSHint.createProblem(JSHint.java:220) at com.eclipsesource.jshint.JSHint.handleProblems(JSHint.java:209) at com.eclipsesource.jshint.JSHint.check(JSHint.java:154) at com.eclipsesource.jshint.ui.internal.builder.JSHintBuilderVisitor.check(JSHintBuilderVisitor.java:107) ... 25 more

ralfstx commented 10 years ago

I've never been able to reproduce this type of error. However, it can happen when jshint reports an error with an unexpected line number. Since this exception can be caused from outside of jshint-eclipse, i've added a safeguard in commit 67f8c729ed78177d99e853209cf9af8228463442.