diff options
author | Eugene Vigdorchik <eugenevigdorchik@epfl.ch> | 2011-04-11 06:42:47 +0000 |
---|---|---|
committer | Eugene Vigdorchik <eugenevigdorchik@epfl.ch> | 2011-04-11 06:42:47 +0000 |
commit | 659f8ba6734439a411e911f0be0b2f4c152c4d1e (patch) | |
tree | 71ac001e62defcc77239868524fd726fff068f6b /src/compiler | |
parent | 112dc4f2a8fca6fb1a692a9891713eff5a32cb1f (diff) | |
download | scala-659f8ba6734439a411e911f0be0b2f4c152c4d1e.tar.gz scala-659f8ba6734439a411e911f0be0b2f4c152c4d1e.tar.bz2 scala-659f8ba6734439a411e911f0be0b2f4c152c4d1e.zip |
Tighten the visibility of interactive.Global.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/Global.scala | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index a143d624bc..2563feeb72 100644 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -277,7 +277,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") * @param pos The position of the tree if polling while typechecking, NoPosition otherwise * */ - protected[interactive] def pollForWork(pos: Position) { + private[interactive] def pollForWork(pos: Position) { if (!interruptsEnabled) return if (pos == NoPosition || nodesSeen % yieldPeriod == 0) Thread.`yield`() @@ -386,7 +386,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") private var threadId = 0 /** The current presentation compiler runner */ - @volatile protected[interactive] var compileRunner = newRunnerThread() + @volatile private[interactive] var compileRunner = newRunnerThread() /** Create a new presentation compiler runner. */ @@ -553,7 +553,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } } - protected def reloadSource(source: SourceFile) { + private def reloadSource(source: SourceFile) { val unit = new RichCompilationUnit(source) unitOfFile(source.file) = unit reset(unit) @@ -561,7 +561,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** Make sure a set of compilation units is loaded and parsed */ - protected def reloadSources(sources: List[SourceFile]) { + private def reloadSources(sources: List[SourceFile]) { newTyperRun() minRunId = currentRunId sources foreach reloadSource @@ -569,7 +569,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** Make sure a set of compilation units is loaded and parsed */ - protected def reload(sources: List[SourceFile], response: Response[Unit]) { + private[interactive] def reload(sources: List[SourceFile], response: Response[Unit]) { informIDE("reload: " + sources) lastWasReload = true respond(response)(reloadSources(sources)) @@ -577,7 +577,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** A fully attributed tree located at position `pos` */ - protected def typedTreeAt(pos: Position): Tree = getUnit(pos.source) match { + private def typedTreeAt(pos: Position): Tree = getUnit(pos.source) match { case None => reloadSources(List(pos.source)) val result = typedTreeAt(pos) @@ -612,7 +612,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** A fully attributed tree corresponding to the entire compilation unit */ - protected def typedTree(source: SourceFile, forceReload: Boolean): Tree = { + private def typedTree(source: SourceFile, forceReload: Boolean): Tree = { informIDE("typedTree " + source + " forceReload: " + forceReload) val unit = getOrCreateUnitOf(source) if (forceReload) reset(unit) @@ -622,18 +622,18 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** Set sync var `response` to a fully attributed tree located at position `pos` */ - protected def getTypedTreeAt(pos: Position, response: Response[Tree]) { + private[interactive] def getTypedTreeAt(pos: Position, response: Response[Tree]) { respond(response)(typedTreeAt(pos)) } /** Set sync var `response` to a fully attributed tree corresponding to the * entire compilation unit */ - protected def getTypedTree(source: SourceFile, forceReload: Boolean, response: Response[Tree]) { + private[interactive] def getTypedTree(source: SourceFile, forceReload: Boolean, response: Response[Tree]) { respond(response)(typedTree(source, forceReload)) } /** Implements CompilerControl.askLinkPos */ - protected def getLinkPos(sym: Symbol, source: SourceFile, response: Response[Position]) { + private[interactive] def getLinkPos(sym: Symbol, source: SourceFile, response: Response[Position]) { informIDE("getLinkPos "+sym+" "+source) respond(response) { val preExisting = unitOfFile isDefinedAt source.file @@ -696,7 +696,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") import analyzer.{SearchResult, ImplicitSearch} - protected def getScopeCompletion(pos: Position, response: Response[List[Member]]) { + private[interactive] def getScopeCompletion(pos: Position, response: Response[List[Member]]) { informIDE("getScopeCompletion" + pos) respond(response) { scopeMembers(pos) } } @@ -737,7 +737,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** Return all members visible without prefix in context enclosing `pos`. */ - protected def scopeMembers(pos: Position): List[ScopeMember] = { + private def scopeMembers(pos: Position): List[ScopeMember] = { typedTreeAt(pos) // to make sure context is entered val context = doLocateContext(pos) val locals = new Members[ScopeMember] @@ -770,13 +770,13 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") result } - protected def getTypeCompletion(pos: Position, response: Response[List[Member]]) { + private[interactive] def getTypeCompletion(pos: Position, response: Response[List[Member]]) { informIDE("getTypeCompletion " + pos) respondGradually(response) { typeMembers(pos) } //if (debugIDE) typeMembers(pos) } - protected def typeMembers(pos: Position): Stream[List[TypeMember]] = { + private def typeMembers(pos: Position): Stream[List[TypeMember]] = { var tree = typedTreeAt(pos) // if tree consists of just x. or x.fo where fo is not yet a full member name @@ -846,7 +846,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** Implements CompilerControl.askLoadedTyped */ - protected def waitLoadedTyped(source: SourceFile, response: Response[Tree], onSameThread: Boolean = true) { + private[interactive] def waitLoadedTyped(source: SourceFile, response: Response[Tree], onSameThread: Boolean = true) { getUnit(source) match { case Some(unit) => if (unit.isUpToDate) { @@ -867,7 +867,7 @@ class Global(settings: Settings, reporter: Reporter, projectName: String = "") } /** Implements CompilerControl.askParsedEntered */ - protected def getParsedEntered(source: SourceFile, keepLoaded: Boolean, response: Response[Tree], onSameThread: Boolean = true) { + private[interactive] def getParsedEntered(source: SourceFile, keepLoaded: Boolean, response: Response[Tree], onSameThread: Boolean = true) { getUnit(source) match { case Some(unit) => getParsedEnteredNow(source, response) |