result_file_regex is really cool, but sometimes it’s not enough.
We develop the Scala compiler. Our build process involves compiling ourselves with a stable version of scalac. Hence, compilation errors might fall into two categories:
- scalac compilation errors such as:
C:\Projects\KeplerUnderRefactoring\src\compiler\scala\tools\nsc\typechecker\Macros.scala:648: error: type mismatch;
found : c.Expr[Any]
(which expands to) c.mirror.Expr[Any]
required: c.Expr[scala.reflect.base.Universe]
(which expands to) c.mirror.Expr[scala.reflect.base.Universe]
scala.reflect.makro.internal.materializeArrayTag_impl(c)(args(1).asInstanceOf[c.Expr[Any]])(args(2).asInstanceOf[c.TypeTag[_]])
^
C:\Projects\KeplerUnderRefactoring\src\compiler\scala\tools\nsc\typechecker\Macros.scala:653: error: type mismatch;
found : c.Expr[Any]
(which expands to) c.mirror.Expr[Any]
required: c.Expr[scala.reflect.base.Universe]
(which expands to) c.mirror.Expr[scala.reflect.base.Universe]
scala.reflect.makro.internal.materializeErasureTag_impl(c)(args(1).asInstanceOf[c.Expr[Any]])(args(2).asInstanceOf[c.TypeTag[_]])
- scalac crashes which show Java stack traces:
error: scala.reflect.internal.MissingRequirementError: package object scala.reflect.makro.internal not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17)
at scala.reflect.internal.Definitions$Roots.getPackageObject(Definitions.scala:169)
at scala.reflect.internal.Definitions$DefinitionsClass.MacroInternalPackage(Definitions.scala:672)
at scala.reflect.internal.Definitions$DefinitionsClass.MacroInternal_materializeArrayTag(Definitions.scala:673)
at scala.tools.nsc.typechecker.Macros$class.$init$(Macros.scala:648)
“Go to error” for errors of type #1 works flawlessly, since it’s easy to make scalac display absolute paths in errors. Type #2 is tricky, because the JVM only prints class names in its stack traces. Hence I need to somehow inject into Sublime’s logic that navigates from an error to its file. In emacs I was able to write an advice around compilation-find-file
, but what do I do in Sublime?