xsbt
ExtractUsedNames
Instance Constructors
-
new
ExtractUsedNames(global: GlobalType)
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
val
DummyValue: Int
-
val
LocalChild: scala.reflect.internal.StdNames.tpnme.NameType
-
-
-
val
Nullary: GlobalType.NullaryMethodType.type
-
-
val
ScalaObjectClass: GlobalType.ClassSymbol
-
final
def
asInstanceOf[T0]: T0
-
def
className(s: GlobalType.Symbol): String
-
def
classNameAsSeenIn(in: GlobalType.Symbol, s: GlobalType.Symbol): String
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
extract(unit: GlobalType.CompilationUnit): Map[String, Set[String]]
-
def
finalize(): Unit
-
def
flatclassName(s: GlobalType.Symbol, sep: Char, dollarRequired: Boolean): String
-
def
flatname(s: GlobalType.Symbol, separator: Char): String
-
final
def
getClass(): Class[_]
-
val
global: GlobalType
-
def
hasMacro(s: GlobalType.Symbol): Boolean
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
def
isTopLevelModule(sym: GlobalType.Symbol): Boolean
-
def
moduleSuffix(s: GlobalType.Symbol): String
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
implicit
def
symbolCompat(sym: GlobalType.Symbol): SymbolCompat
-
def
symbolsInType(tp: GlobalType.Type): Set[GlobalType.Symbol]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Extracts simple names used in given compilation unit.
Extracts simple (unqualified) names mentioned in given in non-definition position by collecting all symbols associated with non-definition trees and extracting names from all collected symbols. Also extract the names of the types of non-definition trees (see source-dependencies/types-in-used-names-* and source-dependencies/as-seen-from-* for examples where this is required).
If given symbol is mentioned both in definition and in non-definition position (e.g. in member selection) then that symbol is collected. It means that names of symbols defined and used in the same compilation unit are extracted. We've considered not extracting names of those symbols as an optimization strategy. It turned out that this is not correct. Check https://github.com/gkossakowski/sbt/issues/3 for an example of scenario where it matters.
All extracted names are returned in _decoded_ form. This way we stay consistent with the rest of incremental compiler which works with names in decoded form.
Names mentioned in Import nodes are handled properly but require some special logic for two reasons:
<import
>. I (gkossakowski) tried to track down what role this symbol serves but I couldn't. It doesn't look like there are many places in Scala compiler that refer to that kind of symbols explicitly. 2. ImportSelector is not subtype of Tree therefore is not processed byTree.foreach
Another type of tree nodes that requires special handling is TypeTree. TypeTree nodes has a little bit odd representation:
The tree walking algorithm walks into TypeTree.original explicitly.