Created
December 27, 2017 17:49
-
-
Save Sciss/b6bc47ffcdbc5a9aa4b8678c85718dd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Simon Schäfer in Scala-IDE gitter | |
| val outputDir = new VirtualDirectory("<virtualdir>", None) | |
| val settings = new Settings(err ⇒ Console.err.println(err)) | |
| settings.outputDirs.setSingleOutput(outputDir) | |
| settings.usejavacp.value = true | |
| settings.source.value = ScalaVersion("2.12.1") | |
| val reporter = new StoreReporter | |
| val compiler = new Global(settings, reporter) | |
| import compiler._ | |
| val src = "class Test { val x = 0 }" | |
| val srcFile = newSourceFile(src) | |
| val run = new compiler.Run | |
| val resp = new Response[compiler.Tree] | |
| import compiler._ | |
| val resp1 = new Response[Unit] | |
| compiler.askReload(List(srcFile), resp1) | |
| resp1.get | |
| compiler.askLoadedTyped(srcFile, keepLoaded = true, resp) | |
| val tree = resp.get.left.get |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment