@@ -77,8 +77,8 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
7777 }
7878
7979 // Like in `ZipArchiveFileLookup` we assume that zips are immutable
80- private val zipClassPathClasses : Seq [String ] = {
81- val names = new mutable.ListBuffer [String ]
80+ private val zipClassPathClasses : Seq [TypeName ] = {
81+ val names = new mutable.ListBuffer [TypeName ]
8282 zipClassPaths.foreach { zipCp =>
8383 val zipFile = new ZipFile (zipCp.zipFile)
8484 classesFromZip(zipFile, names)
@@ -105,7 +105,7 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
105105 def sourceTreesContaining (id : String )(implicit ctx : Context ): List [SourceTree ] = {
106106 val fromBuffers = openedTrees.values.flatten.toList
107107 val fromCompilationOutput = {
108- val classNames = new mutable.ListBuffer [String ]
108+ val classNames = new mutable.ListBuffer [TypeName ]
109109 val output = ctx.settings.outputDir.value
110110 if (output.isDirectory) {
111111 classesFromDir(output.jpath, classNames)
@@ -114,8 +114,7 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
114114 classesFromZip(zipFile, classNames)
115115 }
116116 classNames.flatMap { cls =>
117- val className = cls.toTypeName
118- treesFromClassName(className, id = " " )
117+ treesFromClassName(cls, id)
119118 }
120119 }
121120 (fromBuffers ++ fromCompilationOutput).distinct
@@ -138,8 +137,7 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
138137 def allTreesContaining (id : String )(implicit ctx : Context ): List [SourceTree ] = {
139138 val fromSource = openedTrees.values.flatten.toList
140139 val fromClassPath = (dirClassPathClasses ++ zipClassPathClasses).flatMap { cls =>
141- val className = cls.toTypeName
142- treesFromClassName(className, id)
140+ treesFromClassName(cls, id)
143141 }
144142 (fromSource ++ fromClassPath).distinct
145143 }
@@ -205,8 +203,8 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
205203 // FIXME: classfiles in directories may change at any point, so we retraverse
206204 // the directories each time, if we knew when classfiles changed (sbt
207205 // server-mode might help here), we could do cache invalidation instead.
208- private def dirClassPathClasses : Seq [String ] = {
209- val names = new mutable.ListBuffer [String ]
206+ private def dirClassPathClasses : Seq [TypeName ] = {
207+ val names = new mutable.ListBuffer [TypeName ]
210208 dirClassPaths.foreach { dirCp =>
211209 val root = dirCp.dir.toPath
212210 classesFromDir(root, names)
@@ -215,19 +213,19 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
215213 }
216214
217215 /** Adds the names of the classes that are defined in `zipFile` to `buffer`. */
218- private def classesFromZip (zipFile : ZipFile , buffer : mutable.ListBuffer [String ]): Unit = {
216+ private def classesFromZip (zipFile : ZipFile , buffer : mutable.ListBuffer [TypeName ]): Unit = {
219217 try {
220218 for {
221219 entry <- zipFile.stream.toArray((size : Int ) => new Array [ZipEntry ](size))
222220 name = entry.getName
223221 tastySuffix <- tastySuffixes.find(name.endsWith)
224- } buffer += name.replace(" /" , " ." ).stripSuffix(tastySuffix)
222+ } buffer += name.replace(" /" , " ." ).stripSuffix(tastySuffix).toTypeName
225223 }
226224 finally zipFile.close()
227225 }
228226
229227 /** Adds the names of the classes that are defined in `dir` to `buffer`. */
230- private def classesFromDir (dir : Path , buffer : mutable.ListBuffer [String ]): Unit = {
228+ private def classesFromDir (dir : Path , buffer : mutable.ListBuffer [TypeName ]): Unit = {
231229 try
232230 Files .walkFileTree(dir, new SimpleFileVisitor [Path ] {
233231 override def visitFile (path : Path , attrs : BasicFileAttributes ) = {
@@ -237,7 +235,7 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
237235 tastySuffix <- tastySuffixes
238236 if name.endsWith(tastySuffix)
239237 } {
240- buffer += dir.relativize(path).toString.replace(" /" , " ." ).stripSuffix(tastySuffix)
238+ buffer += dir.relativize(path).toString.replace(" /" , " ." ).stripSuffix(tastySuffix).toTypeName
241239 }
242240 }
243241 FileVisitResult .CONTINUE
0 commit comments