Warnings disappear from Problems View (easy to reproduce)
This has been posted to the Mailing List by Simon Schäfer 2 years ago already (https://groups.google.com/forum/#!msg/scala-ide-user/bz_qbE_mN-8/NT7lcroAvq8J)
It is very simple to reproduce.
I am using
- latest ScalaIDE Build id: 4.1.0-vfinal-20150525-1102-Typesafe
- Playframework 2.4
- activator-1.3.4
- Java 8
on Ubuntu 12.04 LTS.
Create a new play-java project, add
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0-RC2")
to your project/plugins.sbt
(or just clone https://github.com/mkurz/ide-warnings-bug)
Then run
activator compile eclipse
Then import the project into ScalaIDE.
There are NO warnings - but there should be some :-(
Select the project, goto "Project" -> "Clean..." and clean the project - woohoo the warnings appear in the Problems view!!!
NOW: Select the project, hit F5 -> the warnings are gone!
You can repeat the last two steps as often as you want - Warnings appear, then they disappear.
It would be nice if this could be fixed asap. Thanks!
It is very simple to reproduce.
I am using
- latest ScalaIDE Build id: 4.1.0-vfinal-20150525-1102-Typesafe
- Playframework 2.4
- activator-1.3.4
- Java 8
on Ubuntu 12.04 LTS.
Create a new play-java project, add
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0-RC2")
to your project/plugins.sbt
(or just clone https://github.com/mkurz/ide-warnings-bug)
Then run
activator compile eclipse
Then import the project into ScalaIDE.
There are NO warnings - but there should be some :-(
Select the project, goto "Project" -> "Clean..." and clean the project - woohoo the warnings appear in the Problems view!!!
NOW: Select the project, hit F5 -> the warnings are gone!
You can repeat the last two steps as often as you want - Warnings appear, then they disappear.
It would be nice if this could be fixed asap. Thanks!
Leave a comment
on 2015-06-15 15:18 *
By Simon Schäfer
I can't reproduce this problem. The warnings don't disappear when I press F5, they stay were they are.
I can reproduce this on 2 more machines, one running Ubuntu 12.04 too and one running Windows 7 32 bit. Both with Java 8. Both with a complete fresh install of ScalaIDE (not .eclipse folder, no workspace). So I could reproduce this issue on 3 different machines running 2 different OS.
The only difference was on Windows 7 the warnings stayed after importing, but as soon as you cleaned the project and then selected it and hit F5 the warnings disappeared from the Problems tab too.
@sschaef On which system did you try to reproduce?
The only difference was on Windows 7 the warnings stayed after importing, but as soon as you cleaned the project and then selected it and hit F5 the warnings disappeared from the Problems tab too.
@sschaef On which system did you try to reproduce?
Ok, I can reproduce the problem now with the 4.1 build. However, on the nightly build everything works as it should. @mkurz Could you please also have a look if it works in the nightly for you?
on 2015-06-17 10:57 *
By Simon Schäfer
No, there is only an update site: http://scala-ide.org/download/nightly.html
on 2015-06-19 09:31 *
By wpopielarski769697
reproducing...
on 2015-06-19 10:09 *
By wpopielarski769697
reproducible on Windows as well. Slightly different behavior. When Project -> Build Automatically is on warnings appear and disappear after a short moment. Even errors disappear. Continuing...
on 2015-06-19 13:02 *
By wpopielarski769697
Matthias,
problem concerns java warning and errors only (no scala issue) when F5 I guess.
So I see that problem is when we delete java markers from java files. Scala i working correctly because markers are restored from analysis cache as well. Java part doesn't have it. I need to ponder a little on solution
problem concerns java warning and errors only (no scala issue) when F5 I guess.
So I see that problem is when we delete java markers from java files. Scala i working correctly because markers are restored from analysis cache as well. Java part doesn't have it. I need to ponder a little on solution
on 2015-06-19 15:32 *
By wpopielarski769697
So unfortunately there is no good solution for sbt 0.13.6 because in this version there is no information about java compilation result available for sbt.
There is a snippet from BuildScopeUnit:
but line where markers are deleted cannot be removed. It protect us in scenario when for example scala file defines method used in java file but the visibility of this method is insufficient (is private for example). Then after a fix in scala file sbt knows that scala file needs to be rebuilt but because java hasn't be changed java file isn't. If markers weren't be removed then eclipse would still be showing that something wrong is in java file.
It seems that in 0.13.8 java is complied with reporter which can keep problems from compilation. Below is related code snippet of AggressiveCompile from 0.13.8
In 0.13.6 this guy is called only:
I will drill it but I recommend to implement this functionality with #1002481 (Upgrade sbt to version 0.13.8)
There is a snippet from BuildScopeUnit:
private def resetJavaMarkers(javaFiles: Set[IFile]): Set[IFile] = {
javaFiles.foreach { _.deleteMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE) }
javaFiles
}
but line where markers are deleted cannot be removed. It protect us in scenario when for example scala file defines method used in java file but the visibility of this method is insufficient (is private for example). Then after a fix in scala file sbt knows that scala file needs to be rebuilt but because java hasn't be changed java file isn't. If markers weren't be removed then eclipse would still be showing that something wrong is in java file.
It seems that in 0.13.8 java is complied with reporter which can keep problems from compilation. Below is related code snippet of AggressiveCompile from 0.13.8
val loader = ClasspathUtilities.toLoader(searchClasspath)
timed("Java compilation", log) {
try javac.compileWithReporter(javaSrcs.toArray, absClasspath.toArray, output, options.javacOptions.toArray, reporter, log)
catch {
// Handle older APIs
case _: NoSuchMethodError =>
javac.compile(javaSrcs.toArray, absClasspath.toArray, output, options.javacOptions.toArray, log)
}
}
In 0.13.6 this guy is called only:
javac.compile(javaSrcs.toArray, absClasspath.toArray, output, options.javacOptions.toArray, log)
I will drill it but I recommend to implement this functionality with #1002481 (Upgrade sbt to version 0.13.8)
Fix for #1002486
Solves problem with not compiled java files when they depend on scala
files. Additionally there was a problem of disappearing error markers.
Fix #1002486
Branch: master
Commit: scala-ide:fbef29a8af
Solves problem with not compiled java files when they depend on scala
files. Additionally there was a problem of disappearing error markers.
Fix #1002486
Branch: master
Commit: scala-ide:fbef29a8af
on 2015-07-21 23:50 *
By wpopielarski769697
Fix for #1002486
Solves problem with not compiled java files when they depend on scala
files. Additionally there was a problem of disappearing error markers.
Fix #1002486
Branch: ide-release-4.1.1
Commit: scala-ide:c19493cfb6
Solves problem with not compiled java files when they depend on scala
files. Additionally there was a problem of disappearing error markers.
Fix #1002486
Branch: ide-release-4.1.1
Commit: scala-ide:c19493cfb6