scala-ide / scala-search Goto Github PK
View Code? Open in Web Editor NEWNext Scala Search Engine
Next Scala Search Engine
java.lang.AssertionError: assertion failed: Race condition detected: You are running a presentation compiler method outside the PC thread.[phase: <no phase>] Please file a ticket with the current stack trace at https://www.assembla.com/spaces/scala-ide/support/tickets
at scala.tools.nsc.interactive.Global.assertCorrectThread(Global.scala:452)
at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1298)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1239)
at scala.reflect.internal.Importers$StandardImporter.importOrRelink$1(Importers.scala:140)
at scala.reflect.internal.Importers$StandardImporter.importSymbol(Importers.scala:202)
at scala.reflect.internal.Importers$StandardImporter.importOrRelink$1(Importers.scala:148)
at scala.reflect.internal.Importers$StandardImporter.importSymbol(Importers.scala:202)
at scala.reflect.internal.Importers$StandardImporter.importOrRelink$1(Importers.scala:148)
at scala.reflect.internal.Importers$StandardImporter.importSymbol(Importers.scala:202)
at scala.reflect.internal.Importers$StandardImporter.importOrRelink$1(Importers.scala:148)
at scala.reflect.internal.Importers$StandardImporter.importSymbol(Importers.scala:202)
at scala.reflect.internal.Importers$StandardImporter.importSymbol(Importers.scala:27)
at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler.org$scala$tools$eclipse$search$searching$SearchPresentationCompiler$$importSymbol(SearchPresentationCompiler.scala:133)
at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$comparator$1$$anon$1$$anonfun$isSameAs$1$$anonfun$apply$4.apply(SearchPresentationCompiler.scala:78)
at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$comparator$1$$anon$1$$anonfun$isSameAs$1$$anonfun$apply$4.apply(SearchPresentationCompiler.scala:77)
at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
I noticed the following names in the Error Log:
/org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/refactoring/ui/MoveClassRefactoringConfigurationPage.scala
/org.scala-ide.sdt.core.tests/src/tools/eclipse/javaelements/ScalaJavaMapper.scala
/org.scala-ide.sdt.debug/src/scala/tools/eclipse/semantichighlighting/SemanticHighlightingReconciliation.scala
/org.scala-ide.sdt.core/src/s/src/scala/tools/eclipse/classpath/ClasspathTests.scala
/org.scala-ide.play2/src/rc/scala/tools/eclipse/interpreter/InterpreterTabGroup.scala
They all seem to be matching the wrong project with the source file, with some string manipulation gone wrong. The stack trace is usually the same:
org.eclipse.core.internal.resources.ResourceException: Resource '/org.scala-ide.play2/src/rc/scala/tools/eclipse/interpreter/InterpreterTabGroup.scala' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:320)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:194)
at org.eclipse.core.internal.resources.File.getContents(File.java:287)
at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1187)
at org.eclipse.jdt.internal.core.CompilationUnit.getContents(CompilationUnit.java:649)
at scala.tools.eclipse.javaelements.ScalaSourceFile.getContents(ScalaSourceFile.scala:127)
at scala.tools.eclipse.InteractiveCompilationUnit$class.sourceFile$default$1(InteractiveCompilationUnit.scala:37)
at scala.tools.eclipse.javaelements.ScalaSourceFile.sourceFile$default$1(ScalaSourceFile.scala:50)
at scala.tools.eclipse.ScalaPresentationCompiler$$anon$1.default(ScalaPresentationCompiler.scala:58)
at scala.tools.eclipse.ScalaPresentationCompiler$$anon$1.default(ScalaPresentationCompiler.scala:56)
at scala.collection.mutable.HashMap.apply(HashMap.scala:64)
at scala.tools.eclipse.ScalaPresentationCompiler.withSourceFile(ScalaPresentationCompiler.scala:98)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:594)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:593)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:587)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:586)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:41)
at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:95)
at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:586)
at scala.tools.eclipse.ScalaProject.withSourceFile(ScalaProject.scala:595)
at scala.tools.eclipse.InteractiveCompilationUnit$class.withSourceFile(InteractiveCompilationUnit.scala:66)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withSourceFile(ScalaSourceFile.scala:50)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$7.apply(Finder.scala:56)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$7.apply(Finder.scala:48)
at scala.collection.immutable.List.foreach(List.scala:318)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2$$anonfun$apply$4$$anonfun$apply$5.apply(Finder.scala:48)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2$$anonfun$apply$4$$anonfun$apply$5.apply(Finder.scala:43)
at scala.Option.foreach(Option.scala:236)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2$$anonfun$apply$4.apply(Finder.scala:43)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2$$anonfun$apply$4.apply(Finder.scala:42)
at scala.Option.foreach(Option.scala:236)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2.apply(Finder.scala:42)
at org.scala.tools.eclipse.search.searching.Finder$$anonfun$occurrencesOfEntityAt$2.apply(Finder.scala:39)
at scala.tools.eclipse.ScalaPresentationCompiler.withSourceFile(ScalaPresentationCompiler.scala:98)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:594)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:593)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:587)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:586)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:41)
at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:95)
at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:586)
at scala.tools.eclipse.ScalaProject.withSourceFile(ScalaProject.scala:595)
at scala.tools.eclipse.InteractiveCompilationUnit$class.withSourceFile(InteractiveCompilationUnit.scala:66)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withSourceFile(ScalaSourceFile.scala:50)
at org.scala.tools.eclipse.search.searching.Finder$class.occurrencesOfEntityAt(Finder.scala:59)
at org.scala.tools.eclipse.search.SearchPlugin$$anon$1.occurrencesOfEntityAt(SearchPlugin.scala:32)
at org.scala.tools.eclipse.search.handlers.FindOccurrencesOfMethod$$anonfun$execute$2$$anonfun$apply$3$$anonfun$apply$4$$anon$1.run(FindOccurrencesOfMethod.scala:54)
at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
org.eclipse.core.runtime.CoreException: File not found: /Users/dragos/workspace/git/scala/src/library/scala/ScalaObject.scala.
at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:371)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:797)
at org.eclipse.core.internal.resources.File.getContents(File.java:289)
at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1187)
at org.eclipse.jdt.internal.core.CompilationUnit.getContents(CompilationUnit.java:649)
at scala.tools.eclipse.javaelements.ScalaSourceFile.getContents(ScalaSourceFile.scala:127)
at scala.tools.eclipse.InteractiveCompilationUnit$class.sourceFile$default$1(InteractiveCompilationUnit.scala:37)
at scala.tools.eclipse.javaelements.ScalaSourceFile.sourceFile$default$1(ScalaSourceFile.scala:50)
at scala.tools.eclipse.ScalaPresentationCompiler$$anon$1.default(ScalaPresentationCompiler.scala:58)
at scala.tools.eclipse.ScalaPresentationCompiler$$anon$1.default(ScalaPresentationCompiler.scala:56)
at scala.collection.mutable.HashMap.apply(HashMap.scala:64)
at scala.tools.eclipse.ScalaPresentationCompiler.withSourceFile(ScalaPresentationCompiler.scala:98)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:594)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:593)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:587)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:586)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:41)
at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:95)
at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:586)
at scala.tools.eclipse.ScalaProject.withSourceFile(ScalaProject.scala:595)
at scala.tools.eclipse.InteractiveCompilationUnit$class.withSourceFile(InteractiveCompilationUnit.scala:66)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withSourceFile(ScalaSourceFile.scala:50)
at org.scala.tools.eclipse.search.indexing.OccurrenceCollector$.findOccurrences(OccurrenceCollector.scala:36)
at org.scala.tools.eclipse.search.indexing.SourceIndexer$$anonfun$indexScalaFile$2.apply(SourceIndexer.scala:116)
at org.scala.tools.eclipse.search.indexing.SourceIndexer$$anonfun$indexScalaFile$2.apply(SourceIndexer.scala:115)
at scala.util.Success.flatMap(Try.scala:200)
at org.scala.tools.eclipse.search.indexing.SourceIndexer.indexScalaFile(SourceIndexer.scala:115)
at org.scala.tools.eclipse.search.indexing.SourceIndexer$$anonfun$indexIFile$2.apply(SourceIndexer.scala:87)
at org.scala.tools.eclipse.search.indexing.SourceIndexer$$anonfun$indexIFile$2.apply(SourceIndexer.scala:87)
at scala.Option.fold(Option.scala:157)
at org.scala.tools.eclipse.search.indexing.SourceIndexer.indexIFile(SourceIndexer.scala:86)
at org.scala.tools.eclipse.search.indexing.SourceIndexer.indexProject(SourceIndexer.scala:44)
at org.scala.tools.eclipse.search.jobs.ProjectIndexJob.runInWorkspace(ProjectIndexJob.scala:88)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.io.FileNotFoundException: /Users/dragos/workspace/git/scala/src/library/scala/ScalaObject.scala (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:362)
... 34 more
Using the sdt.core project, I searched for askOption
, starting from its definition in ScalaPresentationCompiler
. I noticed that:
SafeSymbol.scala
, there are 5 (the one at line 97 is missing). If I search starting from that occurrence, it finds all 5 of themScalaLaunchShortcut.scala
, out of the 2. Sometimes it finds bothChange it to Ctrl-Shift-G, as the usual Java equivalent (also, it makes it harder to invoke the Java one, by mistake).
It would be nice to group hits in the Search window by the project where they belong. Right now it's hard to know if a file (the path is not absolute) belongs to the same project or not.
In ScalaPresentationCompiler.scala
there are two definitions for askOption
:
/** Ask with a default timeout. Keep around for compatibility with the m2 release. */
def askOption[A](op: () => A): Option[A] = askOption(op, 10000)
/** Perform `op' on the compiler thread. Catch all exceptions, and return
* None if an exception occured. TypeError and FreshRunReq are printed to
* stdout, all the others are logged in the platform error log.
*/
def askOption[A](op: () => A, timeout: Int): Option[A] = {
If I search on the second overload (with the timeout), I get 2 hits:
Multiple opened projects and high "Project Indexing Job" scheduled rate result in flickering IDE UI: small progress bar constantly appears and disappears on status bar. To my eyes it is an annoying visual noise disturbing development process :) Can this activity be hidden?
(BTW, having an indexing on search activation, scheduling can have lower rate, can't it?)
The result view doesn't need to be incremental at this point.
This class is likely too complex and re-implementing platform features. It should be possible to get the same result by implementing only IStyledLabelProvider
, and wrapping it inside a DelegatingStyledCellLabelProvider
.
It seems it calls Lucene checkIndex
way too often. I see my Eclipse using around 100% of one core constantly when I have this plugin installed. It's a showstopper.
(searching for prefStore
in ScalaProject.scala
at line 532
.
java.lang.NullPointerException
at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$10.apply(SearchPresentationCompiler.scala:164)
at org.scala.tools.eclipse.search.searching.SearchPresentationCompiler$$anonfun$symbolAt$1$$anonfun$apply$10.apply(SearchPresentationCompiler.scala:164)
at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:339)
at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.