summaryrefslogtreecommitdiff
path: root/src/repl
Commit message (Collapse)AuthorAgeFilesLines
...
| * Remove used param and document positionDeltaJason Zaugg2015-09-212-3/+3
| |
| * Hide some completion candidates on the first TABJason Zaugg2015-09-091-4/+15
| | | | | | | | | | | | When `foo.<TAB>`, assume you don't want to see the inherited members from Any_ and universally applicable extension methods like `ensuring`. Hitting <TAB> a second time includes them in the results.
| * Fix completion for multi-line entriesJason Zaugg2015-09-093-16/+20
| | | | | | | | | | | | | | | | | | We need to include the previously entered lines into the code that we presentation compile. Management of this state makes the interpret method non tail recursive, so we could blow the default stack with a multi-line entry of hundreds of lines. I think thats an acceptable limitation.
| * Camel Case and JavaBean completionJason Zaugg2015-09-081-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just too useful to leave on the cutting room floor. ``` scala> classOf[String].enclo<TAB> scala> classOf[String].getEnclosing getEnclosingClass getEnclosingConstructor getEnclosingMethod scala> classOf[String].simpl<TAB> scala> classOf[String].getSimpleName type X = global.TTWD<TAB> scala> type X = global.TypeTreeWithDeferredRefCheck ``` I revised the API of `matchingResults` as it was clunky to reuse the filtering on accessibility and term/type-ness while providing a custom name matcher.
| * Sort completion proposalsJason Zaugg2015-09-031-1/+1
| |
| * Don't offer `asInstanceOf` et al as completions in a fresh REPLJason Zaugg2015-09-031-1/+3
| | | | | | | | | | Trying harder to keep the synthetic interpretter wrapper classes behind the curtain
| * Add the prefix the autocompletion results (Scope-, TypeMember)Jason Zaugg2015-09-031-8/+7
| | | | | | | | | | This makes life easier for clients of these APIs, we use this to avoid passing this around in the wrapper result `TypeMembers`.
| * Remove unneeded codeJason Zaugg2015-09-031-5/+3
| | | | | | | | Move misplaced and malindented comment and remove two lines of unneeded code.
| * Use the presentation compiler to drive REPL tab completionJason Zaugg2015-09-027-34/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old implementation is still avaiable under a flag, but we'll remove it in due course. Design goal: - Push as much code in src/interactive as possible to enable reuse outside of the REPL - Don't entangle the REPL completion with JLine. The enclosed test case drives the REPL and autocompletion programatically. - Don't hard code UI choices, like how to render symbols or how to filter candidates. When completion is requested, we wrap the entered code into the same "interpreter wrapper" synthetic code as is done for regular execution. We then start a throwaway instance of the presentation compiler, which takes this as its one and only source file, and has a classpath formed from the REPL's classpath and the REPL's output directory (by default, this is in memory). We can then typecheck the tree, and find the position in the synthetic source corresponding to the cursor location. This is enough to use the new completion APIs in the presentation compiler to prepare a list of candidates. We go to extra lengths to allow completion of partially typed identifiers that appear to be keywords, e.g `global.def` should offer `definitions`. Two secret handshakes are included; move the the end of the line, type `// print<TAB>` and you'll see the post-typer tree. `// typeAt 4 6<TAB>` shows the type of the range position within the buffer. The enclosed unit test exercises most of the new functionality.
| * SI-5408 Prompt after incomplete script pasteSom Snytt2015-09-022-66/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transcript paste mode invites the user to keep typing like regular paste mode, but really you must enter more transcript. This matters if the script ends in the middle of incomplete code that the user wants to complete by hand. Previously, ``` scala> scala> def f() = { // Detected repl transcript paste: ctrl-D to finish. // Replaying 1 commands from transcript. scala> def f() = { scala> scala> def f() = { // Detected repl transcript paste: ctrl-D to finish. | } // Replaying 1 commands from transcript. scala> def f() = { } f: ()Unit ``` Now, ``` scala> scala> def f() = { // Detected repl transcript. Paste more, or ctrl-D to finish. // Replaying 1 commands from transcript. scala> def f() = { | 42 | } f: ()Int scala> f() res0: Int = 42 ```
| * Update power mode bannerSom Snytt2015-09-022-24/+26
| | | | | | | | | | | | | | | | | | | | | | The classic banner is available under -Dscala.repl.power.banner=classic. ``` scala> :power Power mode enabled. :phase is at typer. import scala.tools.nsc._, intp.global._, definitions._ Try :help or completions for vals._ and power._ ```
| * SI-9450 Fix triple quoted strings in REPL :power modeJason Zaugg2015-08-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some extra synthetic code generated under this mode failed to escape input before adding it to a literal string. It used to get away with this most of the time by triple quoting the literal. This commit reuses Scala string escaping logic buried in `Constant` to do this properly. Actually, the proper approach would be to build the synthetic code with trees and quasiquotes, and avoid the mess of stringly-genererated code. I threw in some defensive hygiene for the reference to `Nil` while I was in the neighbourhood.
* | Merge remote-tracking branch 'origin/2.11.x' into 2.12.xSeth Tisue2015-09-081-2/+4
| | | | | | | | | | | | | | | | only trivial merge conflicts here. not dealing with PR #4333 in this merge because there is a substantial conflict there -- so that's why I stopped at 63daba33ae99471175e9d7b20792324615f5999b for now
* | Merge remote-tracking branch 'origin/2.11.x' into 2.12.xSeth Tisue2015-08-202-11/+23
|\| | | | | | | | | | | | | | | | | | | all conflicts were because the changes changed code that doesn't exist anymore in 2.12; they were resolved with `git checkout --ours` c201eac changed bincompat-forward.whitelist.conf but I dropped the change in this merge because it refers to AbstractPromise which no longer exists in 2.12
| * SI-1931 Hide Predef.any2stringadd in REPLSom Snytt2015-07-062-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | User imports that reference Predef are relocated to the top of the wrapping template so that they can hide implicits defined in Predef. Only one import from Predef is retained for special treatment. This is simple and sane. The test shows that `import Predef._` restores Predef implicits even if a user-defined term would normally be in scope. A smart `:import` command to turn off or quarantine imports explicitly would allow fine-grained control.
* | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-07-135-27/+61
|\| | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20150713 Conflicts: src/eclipse/partest/.classpath src/eclipse/repl/.classpath test/files/run/nothingTypeNoFramesNoDce.scala test/files/run/repl-javap-app.check Also fixup two .classpath files with updated partest, xml and parser combinators JARs.
| * Correct init order between Pasted and ILoop#pastedAdriaan Moors2015-07-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | `testBoth` cannot be a val in `Pasted`, as `Pasted` is inherited by `object paste` in ILoop, which would cause `val testBoth` to be initialized before `val PromptString` was: ``` object paste extends Pasted { val PromptString = prompt.lines.toList.last ``` See https://scala-webapps.epfl.ch/jenkins/job/scala-nightly-checkinit-2.11.x/417. Introduced by #4564.
| * Merge pull request #4576 from som-snytt/issue/9206-moreSeth Tisue2015-07-014-26/+54
| |\ | | | | | | SI-9206 REPL custom bits
| | * SI-9206 Update REPL welcome messageSom Snytt2015-06-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Everyone knows that a `help` command will result in `more information`. This commit moves the version string to the second line and adds some verve to the welcome. If anyone can't live without the old banner, they are now able to configure it explicitly, so there is still no blood on our hands. ``` $ scala Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40). Type in expressions to have them evaluated. Type :help for more information. scala> :quit $ skala Welcome to Scala! version 2.11.7-20150623-155244-eab44dd092 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40). Type in expressions for evaluation. Or try :help. scala> :quit ``` REPL tests now lop off the actual length of the welcome header; or, if necessary, remove the version number from a header embedded in output.
| | * SI-9206 REPL custom continuation promptSom Snytt2015-06-232-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because who doesn't want to customize their continuation prompt? `scala -Dscala.repl.continue="..."` looks especially nice with `-Dscala.color`. Somewhat works when pasting, but the test rig for running a transcript does not seek to support custom secondary prompts.
| | * SI-9206: REPL custom welcome messageSom Snytt2015-06-234-17/+37
| | | | | | | | | | | | | | | | | | | | | | | | Can be specified by `-Dscala.repl.welcome=Greeting` or in properties file. It takes the same format arguments as the prompt, viz, version, Java version and JVM name. It can be disabled by `-Dscala.repl.welcome` with no text.
| | * SI-9206: No REPL message on :silent, unless -Dscala.repl.infoIgor Racic2015-06-231-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Anyone who doesn't understand why result printing was turned off after they entered `:silent` mode will start the REPL with `-Dscala.repl.debug` and be enlightened. For infotainment purposes, the verbose message is also emitted under info mode.
| * | Fix 8 typos (j-l)Janek Bogucki2015-06-231-3/+3
| |/
* / SI-9277 Downgrade marginal javap featuresSom Snytt2015-06-252-476/+129
|/ | | | Drop Java 6 support, -fun, -app, and -raw options.
* Merge pull request #4564 from som-snytt/issue/promptv2.11.7Adriaan Moors2015-06-225-92/+97
|\ | | | | SI-9206 Fix REPL code indentation
| * SI-9206 Local refactor to save eyesightSom Snytt2015-06-212-42/+39
| | | | | | | | | | | | We talk about bit rot but not about how dust accumulates on code that hasn't been swept since the last time the furniture was moved around.
| * SI-9206 Accept paste with custom promptSom Snytt2015-06-212-19/+21
| | | | | | | | But sans test.
| * SI-9206 Verbose REPL prompt for info modeSom Snytt2015-06-191-6/+7
| | | | | | | | | | | | Only for exactly `-Dscala.repl.info`, include the complete version number string in the REPL prompt. One could imagine this is the mode for posting snippets to stackoverflow.
| * SI-9206 Fix REPL code indentationSom Snytt2015-06-194-32/+29
| | | | | | | | | | | | | | | | | | | | To make code in error messages line up with the original line of code, templated code is indented by the width of the prompt. Use the raw prompt (without ANSI escapes or newlines) to determine the indentation. Also, indent only once per line.
| * SI-9206 REPL prompt is more easily configuredSom Snytt2015-06-192-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scala shell prompt can be provided as either a system property or in compiler.properties. The prompt string is taken as a format string with one argument that is the version string. ``` $ scala -Dscala.repl.prompt="%nScala %s> " Welcome to Scala version 2.11.7-20150616-093756-43a56fb5a1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_45). Type in expressions to have them evaluated. Type :help for more information. Scala 2.11.7-20150616-093756-43a56fb5a1> 42 res0: Int = 42 Scala 2.11.7-20150616-093756-43a56fb5a1> :quit ```
* | SI-9339 Support classpaths with no single compatible jlineAdriaan Moors2015-06-185-348/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As usual, the repl will use whatever jline 2 jar on the classpath, if there is one. Failing that, there's a fallback and an override. If instantiating the standard `jline.InteractiveReader` fails, we fall back to an embedded, shaded, version of jline, provided by `jline_embedded.InteractiveReader`. (Assume `import scala.tools.nsc.interpreter._` for this message.) The instantiation of `InteractiveReader` eagerly exercises jline, so that a linkage error will result if jline is missing or if the provided one is not binary compatible. The property `scala.repl.reader` overrides this behavior, if set to the FQN of a class that looks like `YourInteractiveReader` below. ``` class YourInteractiveReader(completer: () => Completion) extends InteractiveReader ``` The repl logs which classes it tried to instantiate under `-Ydebug`. # Changes to source & build The core of the repl (`src/repl`) no longer depends on jline. The jline interface is now in `src/repl-jline`. The embedded jline + our interface to it are generated by the `quick.repl` target. The build now also enforces that only `src/repl-jline` depends on jline. The sources in `src/repl` are now sure to be independent of it, though they do use reflection to instantiate a suitable subclass of `InteractiveReader`, as explained above. The `quick.repl` target builds the sources in `src/repl` and `src/repl-jline`, producing a jar for the `repl-jline` classes, which is then transformed using jarjar to obtain a shaded copy of the `scala.tools.nsc.interpreter.jline` package. Jarjar is used to combine the `jline` jar and the `repl-jline` into a new jar, rewriting package names as follows: - `org.fusesource` -> `scala.tools.fusesource_embedded` - `jline` -> `scala.tools.jline_embedded` - `scala.tools.nsc.interpreter.jline` -> `scala.tools.nsc.interpreter.jline_embedded` Classes not reachable from `scala.tools.**` are pruned, as well as empty dirs. The classes in the `repl-jline` jar as well as those in the rewritten one are copied to the repl's output directory. PS: The sbt build is not updated, sorry. PPS: A more recent fork of jarjar: https://github.com/shevek/jarjar.
* | Centralize dependencies on jlineAdriaan Moors2015-06-1715-273/+314
|/ | | | | | | | | | | | | | Code that depends on jline is now in package `scala.tools.nsc.interpreter.jline`. To make this possible, remove the `entries` functionality from `History`, and add the `historicize` method. Also provide an overload for `asStrings`. Clean up a little along the way in `JLineHistory.scala` and `JLineReader.scala`. Next step: fall back to an embedded jline when the expected jline jar is not on the classpath. The gist of the refactor: https://gist.github.com/adriaanm/02e110d4da0a585480c1
* SI-7747 More tests and logic according to our conclusions on #4522.Prashant Sharma2015-06-101-4/+4
|
* SI-7747 Limit previous change to imports of REPL valsJason Zaugg2015-05-261-5/+10
| | | | | | | | | | | | | We only need to introduce the temporary val in the imports wrapper when we are importing a val or module defined in the REPL. The test case from the previous commit still passes, but we are generating slightly simpler code. Compared to 2.11.6, these two commits result in the following diff: https://gist.github.com/retronym/aa4bd3aeef1ab1b85fe9
* SI-7747 Make REPL wrappers serialization friendlyPrashant Sharma2015-05-262-16/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spark has been shipping a forked version of our REPL for sometime. We have been trying to fold the patches back into the mainline so they can defork. This is the last outstanding issue. Consider this REPL session: ``` scala> val x = StdIn.readInt scala> class A(a: Int) scala> serializedAndExecuteRemotely { () => new A(x) } ``` As shown by the enclosed test, the REPL, even with the Spark friendly option `-Yrepl-class-based`, will re-initialize `x` on the remote system. This test simulates this by running a REPL session, and then deserializing the resulting closure into a fresh classloader based on the class files generated by that session. Before this patch, it printed "evaluating x" twice. This is based on the Spark change described: https://github.com/mesos/spark/pull/535#discussion_r3541925 A followup commit will avoid the `val lineN$read = ` part if we import classes or type aliases only. [Original commit from Prashant Sharma, test case from Jason Zaugg]
* SI-9275 Fix row-first display in REPLSom Snytt2015-04-211-5/+10
| | | | | | | | A missing range check in case anyone ever wants to use ``` -Dscala.repl.format=across ``` which was observed only because of competition from Ammonite.
* Make lambda body public rather than using static accessorJason Zaugg2015-04-171-23/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under -Ydelambdafy:method (the basis of the upcoming "indylambda" translation for -target:jvm-1.8), an anonymous function is currently encoded as: 1. a private method containing the lambda's code 2. a public, static accessor method that allows access to 1 from other classes, namely: 3. an anonymous class capturing free variables and implementing the suitable FunctionN interface. In our prototypes of indylambda, we do away with 3, instead deferring creating of this class to JDK8's LambdaMetafactory by way of an invokedynamic instruction at the point of lambda capture. This facility can use a private method as the lambda target; access is mediated by the runtime-provided instance of `java.lang.invoke.MethodHandles.Lookup` that confers the privelages of the lambda capture call site to the generated implementation class. Indeed, The java compiler uses this to emit private lambda body methods. However, there are two Scala specific factors that make this a little troublesome. First, Scala's optimizer may want to inline the lambda capture call site into a new enclosing class. In general, this isn't a safe optimization, as `invokedynamic` instructions have call-site specific semantics. But we will rely the ability to inline like this in order to eliminate closures altogether where possible. Second, to support lambda deserialization, the Java compiler creates a synthetic method `$dersializeLamda$` in each class that captures them, just to be able to get the suitable access to spin up an anoymous class with access to the private method. It only needs to do this for functional interfaces that extends Serializable, which is the exception rather than the rule. But in Scala, *every* function must support serialization, so blindly copying the Java approach will lead to some code bloat. I have prototyped a hybrid approach to these challenges: use the private method directly where it is allowed, but fall back to using the accessor method in a generic lambda deserializer or in call sites that have been inlined into a new enclosing class. However, the most straight forward approach is to simply emit the lambda bodies as public (with an mangled name and with the SYHTNETIC flag) and use them in all cases. That is what is done in this commit. This does moves us one step backwards from the goals of SI-7085, but it doesn't seem sensible to incur the inconvenience from locking down one small part of our house when we don't have a plan or the budget to complete that job. The REPL has some fancy logic to decompile the bodys of lambdas (`:javap -fun C#m`) which needed tweaking to accomodate this change. I haven't tried to make this backwards compatible with the old encoding as `-Ydelambdafy:method` is still experimental.
* new{Term,Type}Name→{Term,Type}Name, tpename/nme→{type,term}NamesSimon Ochsenreither2015-03-261-3/+3
|
* SI-9170 More flexible SessionTestSom Snytt2015-03-031-9/+14
| | | | | | | | SessionTest session text can include line continuations and pasted text. Pasted script (which looks like a double prompt) probably doesn't work. This commit includes @retronym's SI-9170 one-liner.
* Merge pull request #4251 from retronym/ticket/6502Jason Zaugg2015-02-052-11/+14
|\ | | | | SI-6502 More robust REPL :require
| * REPL: Tread EOF a "no" in the "yes"/"no" prompt.Jason Zaugg2015-01-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we got in an endless loop if using ^D to try to end the session. When piping commands into the REPL, this was rather annoying! ``` scala-hash v2.11.5 Welcome to Scala version 2.11.5-20150101-184742-3fafbc204f (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25). Type in expressions to have them evaluated. Type :help for more information. scala> :require xxx java.lang.NullPointerException at scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$flatten$1(ILoop.scala:651) at scala.tools.nsc.interpreter.ILoop.require(ILoop.scala:654) That entry seems to have slain the compiler. Shall I replay your session? I can re-run each line except the last one. [y/n]^D You must enter y or n. That entry seems to have slain the compiler. Shall I replay your session? I can re-run each line except the last one. [y/n]^D ... ```
| * SI-6502 More robust REPL :requireJason Zaugg2015-01-161-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - handle missing files gracefully (rather than NPE) - read the class name with ASM, rather than with a dummy classloader. The dummy classloader is prone to throwing `LinkageError`s, as reported in the comments of SI-6502. Manual test of the original report: ``` % qscala Welcome to Scala version 2.11.5-20150115-183424-155dbf3fdf (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25). Type in expressions to have them evaluated. Type :help for more information. scala> :require does/not/exist Cannot read: does/not/exist scala> classOf[org.junit.Test] <console>:8: error: object junit is not a member of package org classOf[org.junit.Test] ^ scala> :require /Users/jason/.m2/repository/junit/junit/4.11/junit-4.11.jar Added '/Users/jason/.m2/repository/junit/junit/4.11/junit-4.11.jar' to classpath. scala> classOf[org.junit.Test] res1: Class[org.junit.Test] = interface org.junit.Test ``` I have commited an automated test that is a minimization of this one.
* | Fix many typos in docs and commentsmpociecha2014-12-145-7/+7
|/ | | | | | | | | | | | | This commit corrects many typos found in scaladocs, comments and documentation. It should reduce a bit number of PRs which fix one typo. There are no changes in the 'real' code except one corrected name of a JUnit test method and some error messages in exceptions. In the case of typos in other method or field names etc., I just skipped them. Obviously this commit doesn't fix all existing typos. I just generated in IntelliJ the list of potential typos and looked through it quickly.
* Merge pull request #4176 from mpociecha/flat-classpath2Grzegorz Kossakowski2014-12-052-9/+11
|\ | | | | The alternative, flat representation of classpath elements
| * Cleanup and refactoring - semicolons, unused or commented out codempociecha2014-12-051-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains some minor changes made by the way when implementing flat classpath. Sample JUnit test that shows that all pieces of JUnit infrastructure work correctly now uses assert method form JUnit as it should do from the beginning. I removed commented out lines which were obvious to me. In the case of less obvious commented out lines I added TODOs as someone should look at such places some day and clean them up. I removed also some unnecessary semicolons and unused imports. Many string concatenations using + have been changed to string interpolation. There's removed unused, private walkIterator method from ZipArchive. It seems that it was unused since this commit: https://github.com/scala/scala/commit/9d4994b96c77d914687433586eb6d1f9e49c520f However, I had to add an exception for the compatibility checker because it was complaining about this change. I made some trivial corrections/optimisations like use 'findClassFile' method instead of 'findClass' in combination with 'binary' to find the class file.
| * Integrate flat classpath with the compilermpociecha2014-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit integrates with the compiler the whole flat classpath representation build next to the recursive one as an alternative. From now flat classpath really works and can be turned on. There's added flag -YclasspathImpl with two options: recursive (the default one) and flat. It was needed to make the dynamic dispatch to the particular classpath representation according to the chosen type of a classpath representation. There's added PathResolverFactory which is used instead of a concrete implementation of a path resolver. It turned out that only a small subset of path resolvers methods is used outside this class in Scala sources. Therefore, PathResolverFactory returns an instance of a base interface PathResolverResult providing only these used methods. PathResolverFactory in combination with matches in some other places ensures that in all places using classpath we create/get the proper representation. Also the classPath method in Global is modified to use the dynamic dispatch. This is very important change as a return type changed to the base ClassFileLookup providing subset of old ClassPath public methods. It can be problematic if someone was using in his project the explicit ClassPath type or public methods which are not provided via ClassFileLookup. I tested flat classpath with sbt and Scala IDE and there were no problems. Also was looking at sources of some other projects like e.g. Scala plugin for IntelliJ and there shouldn't be problems, I think, but it would be better to check these changes using the community build. Scalap's Main.scala is changed to be able to use both implementations and also to use flags related to the classpath implementation. The classpath invalidation is modified to work properly with the old (recursive) classpath representation after changes made in a Global. In the case of the attempt to use the invalidation for the flat cp it just throws exception with a message that the flat one currently doesn't support the invalidation. And also that's why the partest's test for the invalidation has been changed to use (always) the old implementation. There's added an adequate comment with TODO to this file. There's added partest test generating various dependencies (directories, zips and jars with sources and class files) and testing whether the compilation and further running an application works correctly, when there are these various types of entries specified as -classpath and -sourcepath. It should be a good approximation of real use cases.
| * Use new asClassPathString method and create FileUtils for classpathmpociecha2014-11-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The method asClasspathString is now deprecated. Moreover it's moved to ClassFileLookup in the case someone was using it in some project (an alternative classpath also will support it - just in the case). All its usages existing in Scala sources are changed to asClassPathString method. The only difference is the name. Some operations on files or their names are moved from ClassPath to the newly created FileUtils dedicated to classpath. It will be possible to reuse them when implementing an alternative classpath representation. Moreover such allocation-free extension methods like the one added in this commit will improve the readability.
* | Merge pull request #4131 from som-snytt/issue/8981Lukas Rytz2014-12-041-28/+27
|\ \ | |/ |/| SI-8981 Tweak REPL help
| * SI-8981 Tweak REPL helpSom Snytt2014-11-141-28/+27
| | | | | | | | | | | | Tweak colon command processing. Fixes an unhelpful message about the ambiguity of colon.
* | Merge pull request #4051 from heathermiller/repl-cp-fix2Jason Zaugg2014-11-182-8/+71
|\ \ | |/ |/| SI-6502 Reenables loading jars into the running REPL (regression in 2.10)