summaryrefslogtreecommitdiff
path: root/src/interactive
Commit message (Collapse)AuthorAgeFilesLines
...
| * SI-8030 force symbols on presentation compiler initializationDen Shabalin2013-12-121-0/+12
| | | | | | | | | | | | | | | | | | This commit forces a number of built-in symbols in presentation compiler to prevent them from being entered during parsing. The property “parsing doesn’t enter new symbols” is tested on a rich source file that contains significant number of variations of Scala syntax.
* | Merge commit '0c92704' into merge/2.10.x-to-masterJason Zaugg2013-12-111-1/+5
|/ | | | | | | | | | | | Conflicts: bincompat-forward.whitelist.conf src/interactive/scala/tools/nsc/interactive/Global.scala test/files/presentation/scope-completion-2.check test/files/presentation/scope-completion-3.check test/files/presentation/scope-completion-import.check Conflicts in the scope completion tests handled with the help of @skyluc in https://github.com/scala/scala/pull/3264
* Merge commit '7d41094' into merge/2.10.x-and-pr-3209-to-masterJason Zaugg2013-12-065-15/+23
| | | | | Conflicts: src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
* Merge commit '7c1d114' into merge-2.10.x-to-masterJason Zaugg2013-12-061-9/+16
| | | | | Conflicts: src/compiler/scala/tools/nsc/interactive/Global.scala
* Merge pull request #3154 from huitseeker/issue/SI-7221-PRJason Zaugg2013-11-221-72/+79
|\ | | | | SI-7221 Rewrites pollForWork non-recursively
| * SI-7221 rewrites pollForWork non-recursivelyFrançois Garillot2013-11-201-72/+79
| | | | | | | | Fixes #1001407
* | Merge pull request #3152 from paulp/pr/deprecationsJason Zaugg2013-11-224-306/+0
|\ \ | | | | | | Removing deprecated code.
| * | Removing deprecated code.Paul Phillips2013-11-184-306/+0
| | | | | | | | | | | | | | | Code which has been deprecated since 2.10.0 and which allowed for straightforward removal.
* | | SI-7280 Remove unneccesary methodLuc Bourlier2013-11-201-3/+0
|/ /
* | SI-7280 Scope completion not returning members provided by importsLuc Bourlier2013-11-151-24/+40
| | | | | | | | | | | | | | | | Updates localeContext() to return the best context possible when there are none directly associated with the given position. It happens when an expression cannot be successfully typed, as no precise ContextTree covers the expression location, or if the position is not inside any expression. Adds corresponding tests
* | Test infrastructure for scope completionJason Zaugg2013-11-154-11/+60
|/ | | | | Adds a new marker /*_*/ to trigger scope completion test. Original type completion test oracles update for the tweaked output
* Merge commit '6045a05b83' into merge-2.10Adriaan Moors2013-11-131-2/+8
| | | | | Conflicts: src/interactive/scala/tools/nsc/interactive/Global.scala
* Refactoring to prepare modularization of the compiler.Adriaan Moors2013-11-122-16/+2
| | | | | | | | | | | | | | | | | | Actual modularization is delayed until 2.12. The one big (one-line) change is to make the interactive compiler independent of scaladoc. We have one "integration test": `MemoryLeaksTest`. This commit adds a bunch of comments marked `TODO: modularize the compiler`, that should be uncommented when we're ready to continue the modularization effort. I decided to merge them commented out to avoid having to rebase xml patches. There's still some chance of bitrot, but I'm willing to take my chances. I previously refactored the build to make it easier to add jars in a coherent way, which hinges on the `init-project-prop` mechanism, so the relevant properties are already injected there.
* Updating Position call sites.Paul Phillips2013-09-272-11/+11
| | | | | | Calling position factories rather than instantiating these particular classes. Not calling deprecated methods. Added a few position combinator methods.
* Merge pull request #2968 from huitseeker/interrupt-koshernessJason Zaugg2013-09-231-2/+8
|\ | | | | Follow good interrupt discipline in Response
| * Follow good interrupt discipline in ResponseFrançois Garillot2013-09-201-2/+8
| | | | | | | | | | Restores the interrupted status of the waiting thread after catching an InterruptException.
* | Add trait keeping comments across new Typer runsFrançois Garillot2013-09-191-0/+13
| |
* | Cull extraneous whitespace.Paul Phillips2013-09-181-4/+0
|/ | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* SI-7643 Enable newPatternMatching in interactive.Jason Zaugg2013-09-061-1/+0
| | | | | | | | | | Without it, the enclosed test fails with: ArrayBuffer(Problem(RangePosition(partial-fun/src/PartialFun.scala, 62, 62, 77),type mismatch; found : Int => Int required: PartialFunction[Int,Int],2)) And with that, we can remove this option altogether.
* SI-6240 Synchronizes NamesJason Zaugg2013-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | Previously we didn't have all possible name creation facilities covered with locks, so some of them silently misbehaved and caused much grief: http://groups.google.com/group/scala-internals/browse_thread/thread/ec1d3e2c4bcb000a. This patch gets all the name factories under control. Rather than relying on subclasses to override mutating methods and add synchronization, they should instead override `synchronizeNames` to return true and leave the placement of the locks up to `reflect.internal.Names`. These locks are placed around sections that mutate `typeHashtable` and `termHashtable`. This is done in the reflection universe, and in the interactive compiler. The latter change will obviate an incomplete attempt do to the same in `ScalaPresentationCompiler` in the scala-ide project.
* Address TODOs around SymbolLoaders and SymbolTable.Grzegorz Kossakowski2013-07-301-8/+4
| | | | | | | | | | | | | | | | | | | | | | SymbolTable refactoring introduced some TODOs that were supposed to be addressed after M5 release. The reason I couldn't address those problems right away was a conflict with our plans to modularize Scaladoc and interactive. However, we decided to delay that work until after M5 is released so addressing TODOs is not blocked anymore. This commit introduces the following changes: * Eclipse project definitions for interactive and scaladoc depend on scala-compiler project so they are builded against latest version of the compiler (quick) instead of STARR. This aligns our Eclipse project definitions with build.xml structure. * Introduce GlobalSymbolLoaders class which wires dependencies of SymbolLoaders with assumption of dependency on Global. * Switch to GlobalSymbolLoaders in BrowsingLoaders, interactive Global and ScaladocGlobal; this eliminates all TODO comments introduced before
* Refactor the cake so SymbolTable does not depend on GlobalGrzegorz Kossakowski2013-07-271-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is rather large commit so I'll first explain the motivation behind it and then go through all changes in detail explaining the choices I made. The motivation behind this refactoring was to make SymbolTable unit testable. I wanted a lightweight way of initializing SymbolTable and then writing unit tests for subtyping algorithm, various functionality related to Symbols, etc. All of that should be possible by precisely controlling what we test, e.g., create types and symbols by hand and not have them defined in source code as we normally do in partest (functional) tests. The other motivation was to reduce and clarify dependencies we have in the compiler. Explicit dependencies lead to cleaner design. Also, explicit and reduces dependencies help incremental compilation which is a big problem for us in compiler's code base at the moment. One of the challenges I faced during that refactoring was cyclic dependency between Platform and SymbolLoaders. Platform depended on `SymbolLoaders.SymbolLoader` because it would define a root loader. SymbolLoaders depended on Platform for numerous reasons like deferring decision how to load a given symbol based on some Platform-specific hooks. I decided to break that cycle by removing methods related to symbol loading from Platform interface. One could argue, that better fix would be to make SymbolLoaders to not depend on Platform (backend) concept but that would be much bigger refactoring. Also, we have a new concept for dealing with symbol loading: Mirrors. For those reasons both `newClassLoader` and `rootLoader` were dropped from Platform interface. Note that JavaPlatform still depends on Global so it can access phases defined in Global to implement `platformPhases` method. Both GenICode and BCodeBodyBuilder have some Platform specific logic that requires casting because pattern matcher doesn't narrow types to give them a proper refinement. Check the changes for details. Some logging utilities has been moved from Global to SymbolTable because they are accessed by SymbolTable. Since Global inherits from SymbolTable this should be a source compatible change. The SymbolLoaders has dependency on `compileLate` method defined in Global. The purpose behind `compileLate` is not clear to me but the dependency looks a little bit dubious. At least we made that dependency explicit. ScaladocGlobal and Global defined in interactive has been adapted in a way that makes them compile both with quick.comp and 2.11.0-M4 so my refactorings are not blocking the modularization effort.
* SI-7592 Remove scala.tools.nsc.util.MultiHashMapSimon Ochsenreither2013-07-101-3/+3
|
* Fix typo in documentationJean-Remi Desjardins2013-07-051-1/+1
|
* Move some code from s.t.n.io to s.t.n.interactiveSimon Ochsenreither2013-06-276-3/+794
| | | | | | | The only usages of scala.tools.nsc.io.{Lexer,Pickler,PrettyWriter, Replayer} can be found in scala.tools.nsc.interactive. Let's move those files closer to their dependencies.
* Make all numeric coercions explicit.Paul Phillips2013-05-272-2/+2
| | | | | | | | | | | | | Optimistically, this is preparation for a day when we don't let numeric types drift with the winds. Even without the optimism it's a good idea. It flushed out an undocumented change in the math package object relative to the methods being forwarded (a type is widened from what is returned in java) so I documented the intentionality of it. Managing type coercions manually is a bit tedious, no doubt, but it's not tedious enough to warrant abandoning type safety just because java did it.
* Concision contribution.Paul Phillips2013-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | We have lots of core classes for which we need not go through the symbol to get the type: ObjectClass.tpe -> ObjectTpe AnyClass.tpe -> AnyTpe I updated everything to use the concise/direct version, and eliminated a bunch of noise where places were calling typeConstructor, erasedTypeRef, and other different-seeming methods only to always wind up with the same type they would have received from sym.tpe. There's only one Object type, before or after erasure, with or without type arguments. Calls to typeConstructor were especially damaging because (see previous commit) it had a tendency to cache a different type than the type one would find via other means. The two types would compare =:=, but possibly not == and definitely not eq. (I still don't understand what == is expected to do with types.)
* An attempt to make tests deterministic.Paul Phillips2013-05-192-1/+6
| | | | | | | | | | | The nondeterminism presently showing itself in presentation/implicit-member is a consequence of the presentation compiler tests relying on details of the behavior of toString calls. We need to stomp this out, but it will take a while. Based on the check file changes enclosed with this commit, this will suffice for the presentation compiler tests. A broader assault will have to take place, but not yet.
* SI-6815 untangle isStable and hasVolatileTypeAdriaan Moors2013-05-162-4/+4
| | | | | | | | | | | | | | | | | | | | | `Symbol::isStable` is now independent of `Symbol::hasVolatileType`, so that we can allow stable identifiers that are volatile in ident patterns. This split is validated by SI-6815 and the old logic in RefChecks, which seems to assume this independence, and thus I don't think ever worked: ``` if (member.isStable && !otherTp.isVolatile) { if (memberTp.isVolatile) overrideError("has a volatile type; cannot override a member with non-volatile type") ``` Introduces `admitsTypeSelection` and `isStableIdentifierPattern` in treeInfo, and uses them instead of duplicating that logic all over the place. Since volatility only matters in the context of type application, `isStableIdentifierPattern` is used to check patterns (resulting in `==` checks) and imports.
* Absolutized paths involving the scala package.Paul Phillips2013-05-033-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* Merge pull request #2483 from adriaanm/merge-2.10.xPaul Phillips2013-05-021-2/+4
|\ | | | | Merge 2.10.x
| * Merge 2.10.x into masterAdriaan Moors2013-05-021-2/+4
| | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-forward.whitelist.conf src/compiler/scala/tools/nsc/matching/Patterns.scala src/compiler/scala/tools/nsc/transform/patmat/Logic.scala src/compiler/scala/tools/nsc/typechecker/Infer.scala src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala test/files/neg/t5663-badwarneq.check
* | More useful checkfile output in interactive tests.Paul Phillips2013-04-302-6/+6
| | | | | | | | | | | | I resisted the urge to fix "aksTypeCompletion" for as long as I possibly could. While I was there I threw in what seem to be like significant output improvements, but you tell me.
* | SI-7362, crash in presentation compiler.Paul Phillips2013-04-301-13/+11
| | | | | | | | Code by retronym, test by huitseeker, I just move stuff around.
* | SI-7291: No exception throwing for diverging implicit expansionHubert Plociniczak2013-04-261-4/+1
|/ | | | | | | | | | | | | | | Since we don't throw exceptions for normal errors it was a bit odd that we don't do that for DivergingImplicit. As SI-7291 shows, the logic behind catching/throwing exception was broken for divergence. Instead of patching it, I rewrote the mechanism so that we now another SearchFailure type related to diverging expansion, similar to ambiguous implicit scenario. The logic to prevent diverging expansion from stopping the search had to be slightly adapted but works as usual. The upside is that we don't have to catch diverging implicit for example in the presentation compiler which was again showing that something was utterly broken with the exception approach.
* Eliminate a pile of -Xlint warnings.Paul Phillips2013-04-233-6/+2
| | | | | | Some unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
* Merge pull request #2327 from paulp/pr/2315-rebasedPaul Phillips2013-04-024-6/+6
|\ | | | | SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlag
| * SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlagSom Snytt2013-03-274-6/+6
| | | | | | | | | | | | | | This commit shortens expressions of the form `if (settings.debug.value)` to `if (settings.debug)` for various settings. Rarely, the setting is supplied as a method argument. The conversion is not employed in simple definitions where the Boolean type would have to be specified.
* | Merge pull request #2316 from vigdorchik/interactive_test_frameworkPaul Phillips2013-03-292-12/+2
|\ \ | |/ |/| Improve testing interactive experience.
| * Improve testing interactive experience.Eugene Vigdorchik2013-03-262-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the exceptions that happen in the test are swallowed, as the JVM is forced to exit before printing the stack trace. Also assert message doesn't contain information about the problem. The call to "sys.exit" masks bugs in the testing framework, that has to be addressed more elaborately, so here we remove it. Also add the message parameter to assert to make it more informative. After removing "sys.exit" call, doc test starts failing. I suspect there might be a problem when expanding doc variables, but this should be addressed separately.
* | Overhauled local/getter/setter name logic.Paul Phillips2013-03-251-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Sifted through extraneous methods trying to find consistency, consolidating and deprecating as I went. The original motivation for all this was the restoration of LOCAL_SUFFIX to originalName, because: It looks like in an attempt to make originalName print consistently with decodedName, I went a little too far and stripped invisible trailing spaces from originalName. This meant outer fields would have an originalName of '$outer' instead of '$outer ', which in turn could have caused them to be mis-recognized as outer accessors, because the logic of outerSource hinges upon "originalName == nme.OUTER". I don't know if this affected anything - I noticed it by inspection, improbably enough. Deprecated originalName - original, compared to what? - in favor of unexpandedName, which has a more obvious complement. Introduced string_== for the many spots where people have given up and are comparing string representations of names. A light dusting of types is still better than nothing. Editoral note: LOCAL_SUFFIX is the worst. Significant trailing whitespace! It's a time bomb.
* Merge pull request #2239 from paulp/pr/warningsAdriaan Moors2013-03-211-1/+1
|\ | | | | Warnings removal and other cleanup.
| * Eliminate a bunch of -Xlint warnings.Paul Phillips2013-03-121-1/+1
| | | | | | | | | | | | Mostly unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
* | Update sbt.latest.version to sbt's latest version.Paul Phillips2013-03-131-2/+3
|/ | | | And tweak deprecated stub so it compiles with 0.12.2.
* Eliminated all forInteractive/forScaladoc uses.Paul Phillips2013-03-092-5/+20
| | | | | | | | This is the commit which brings it all together. The booleans forInteractive and forScaladoc are now deprecated and are not inspected for any purpose. All behavioral changes formerly accomplished via tests of those flags are embodied in the globals built specifically for those tasks.
* Moved interactive code into src/interactive.Paul Phillips2013-03-092-3/+116
| | | | | As with scaladoc, pushes presentation compiler specific code into its separate source area.
* Moved interactive sources into separate directory.Paul Phillips2013-03-0924-0/+3456
As with the preceding commit, this has build-internal effects only.