Skip to content

Instantly share code, notes, and snippets.

@paulp
Created June 23, 2012 20:54
Show Gist options
  • Save paulp/2979938 to your computer and use it in GitHub Desktop.
Save paulp/2979938 to your computer and use it in GitHub Desktop.
# it's fast (in scala terms) because it stops after typer
# it could be a lot faster if it used fsc or something, we're still paying the whole startup cost
# here's a test/demo case
% scalac -d /tmp test/files/run/global-assist.scala
# meta-test
% scala -cp /tmp Test https://raw.github.com/paulp/scala/topic/global-assist/test/files/run/global-assist.scala
// Top Level
object Test
// All methods
def <init>(): Test.type
def dList(xs: List[Any]): List[String]
def dString(xs: List[Any]): String
def main(args: Array[String]): Unit
def show(label: String,what: String): Unit
def symsString(xs: List[r.global.Symbol]): String
def tString(s: r.global.Symbol): String
val demo: String
// Referenced (public) symbols
constructor Object in java.lang.Object
method + in java.lang.String
method apply in scala.collection.immutable.List
method augmentString in scala.Predef
method canBuildFrom in scala.collection.immutable.List
method constantTypes in scala.tools.util.GlobalAssist.TypingRun
method defString in scala.reflect.internal.Symbols.Symbol
method distinct in scala.collection.SeqLike
method format in scala.collection.immutable.StringLike
method fullName in scala.reflect.internal.Symbols.Symbol
method guess in scala.tools.util.GlobalAssist
method idents in scala.tools.util.GlobalAssist.TypingRun
method isDefinedInPackage in scala.reflect.internal.Symbols.Symbol
method isEmpty in scala.collection.IndexedSeqOptimized
method kind in scala.reflect.internal.Symbols.SymbolContextApiImpl
method map in scala.collection.TraversableLike
method methods in scala.tools.util.GlobalAssist.TypingRun
method mkString in scala.collection.TraversableOnce
method owner in scala.reflect.internal.Symbols.Symbol
method println in scala.Predef
method publicReferences in scala.tools.util.GlobalAssist.TypingRun
method refArrayOps in scala.Predef
method sorted in scala.collection.SeqLike
method toList in scala.collection.TraversableOnce
method topLevel in scala.tools.util.GlobalAssist.TypingRun
object String in scala.math.Ordering
object scala.Predef
object scala.collection.immutable.List
object scala.math.Ordering
object scala.tools.util.GlobalAssist
package <empty>
package scala
package scala.tools
package scala.tools.util
type scala.AnyRef
value demo in Test
value global in scala.tools.util.GlobalAssist.TypingRun
value name in scala.reflect.internal.Trees.Ident
// Constant types
String(" ")
String("")
String("%s in %s")
String("All methods")
String("Constant types")
String("Ident names")
String("Referenced (public) symbols")
String("Top Level")
String("\n")
String("\n// %s\n\n%s")
String("\npackage foo {\n class A {\n class Inner\n object Inner\n def method = 5\n }\n object B {\n class Inner\n object Inner\n def method = 10\n }\n\n abstract class Bippy extends Iterator[Int] {\n }\n}\n ")
// Ident names
<empty> _* args args1 dList dString label r s scala show symsString tString what x$1 x$2 x$3 xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment