-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Fix possible concurrency issues after review
- Loading branch information
Showing
12 changed files
with
129 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
metals/src/main/scala/scala/meta/internal/metals/JvmTarget.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,44 @@ | ||
package scala.meta.internal.metals | ||
|
||
import scala.meta.internal.metals.MetalsEnrichments._ | ||
import scala.meta.io.AbsolutePath | ||
|
||
trait JvmTarget { | ||
|
||
/** | ||
* If the build server supports lazy classpath resolution, we will | ||
* not get any classpath data eagerly and we should not | ||
* use this endpoint. It should only be used as a fallback. | ||
* | ||
* This is due to the fact that we don't request classpath as it | ||
* can be resonably expensive. | ||
* | ||
* @return non empty classpath only if it was resolved prior | ||
*/ | ||
def classpath: Option[List[String]] | ||
|
||
def classDirectory: String | ||
|
||
/** | ||
* This method collects jars from classpath defined in scalacOptions. | ||
* | ||
* If the build server supports lazy classpath resolution, we will | ||
* not get any classpath data eagerly and we should not | ||
* use this endpoint. It should only be used as a fallback. | ||
* | ||
* This is due to the fact that we don't request classpath as it | ||
* can be resonably expensive. | ||
* | ||
* We should use the buildTargetDependencyModules information | ||
* from the indexer instead. | ||
* | ||
* @return non empty classpath jar list if it was resolved prior | ||
*/ | ||
def jarClasspath: Option[List[AbsolutePath]] = | ||
classpath.map(collectJars) | ||
|
||
private def collectJars(paths: List[String]) = | ||
paths | ||
.filter(_.endsWith(".jar")) | ||
.map(_.toAbsolutePath) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.