final class BuildTargets extends AnyRef
In-memory cache for looking up build server metadata.
- Alphabetic
- By Inheritance
- BuildTargets
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new BuildTargets(ammoniteBuildServer: (BuildTargetIdentifier) ⇒ Option[BuildServerConnection])
Type Members
- case class InferredBuildTarget(jar: io.AbsolutePath, symbol: String, id: BuildTargetIdentifier) extends Product with Serializable
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addDependencySource(sourcesJar: io.AbsolutePath, target: BuildTargetIdentifier): Unit
- def addJavacOptions(result: JavacOptionsResult): Unit
- def addScalacOptions(result: ScalacOptionsResult): Unit
- def addSourceItem(sourceItem: io.AbsolutePath, buildTarget: BuildTargetIdentifier): Unit
- def addSourceRoot(root: io.AbsolutePath): Unit
- def addWorkspaceBuildTargets(result: WorkspaceBuildTargetsResult): Unit
- def all: Iterator[BuildTarget]
- def allBuildTargetIds: Seq[BuildTargetIdentifier]
- def allInverseDependencies(target: BuildTargetIdentifier): Set[BuildTargetIdentifier]
- def allJava: Iterator[JavaTarget]
- def allScala: Iterator[ScalaTarget]
- def allSourceJars: Iterator[io.AbsolutePath]
- def allTargetRoots: Iterator[io.AbsolutePath]
- def allWorkspaceJars: Iterator[io.AbsolutePath]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def buildServerOf(id: BuildTargetIdentifier): Option[BuildServerConnection]
- def buildTargetSources(id: BuildTargetIdentifier): Iterable[io.AbsolutePath]
- def buildTargetTransitiveDependencies(id: BuildTargetIdentifier): Iterable[BuildTargetIdentifier]
- def buildTargetTransitiveSources(id: BuildTargetIdentifier): Iterator[io.AbsolutePath]
- val buildTargetsOrder: (BuildTargetIdentifier) ⇒ Int
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def findByDisplayName(name: String): Option[BuildTarget]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def inferBuildTarget(toplevels: Iterable[mtags.Symbol]): Option[InferredBuildTarget]
-
def
inferBuildTarget(source: io.AbsolutePath): Option[BuildTargetIdentifier]
Tries to guess what build target this readonly file belongs to from the symbols it defines.
Tries to guess what build target this readonly file belongs to from the symbols it defines.
By default, we rely on carefully recording what build target produced what files in the
.metals/readonly/directory. This approach has the problem that navigation failed to work inreadonly/sources if- a new metals feature forgot to record the build target - a user removes
.metals/metals.h2.dbWhen encountering an unknown
readonly/file we do the following steps to infer what build target it belongs to:- check if file is in
.metals/readonly/dependencies/${source-jar-name}- find the build targets that have a sourceDependency with that nameOtherwise if it's a jar file we find a build target it belongs to.
This approach is not glamorous but it seems to work reasonably well.
- def info(id: BuildTargetIdentifier): Option[BuildTarget]
- def inverseDependencyLeaves(target: BuildTargetIdentifier): Set[BuildTargetIdentifier]
- def inverseDependencySource(sourceJar: io.AbsolutePath): Set[BuildTargetIdentifier]
- def inverseSourceItem(source: io.AbsolutePath): Option[io.AbsolutePath]
-
def
inverseSources(source: io.AbsolutePath): Option[BuildTargetIdentifier]
Returns the first build target containing this source file.
- def isInsideSourceRoot(path: io.AbsolutePath): Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isInverseDependency(query: BuildTargetIdentifier, roots: List[BuildTargetIdentifier]): Boolean
- def javaTarget(id: BuildTargetIdentifier): Option[JavaTarget]
- def javaTargetRoot(buildTarget: BuildTargetIdentifier): Option[io.AbsolutePath]
- def linkSourceFile(id: BuildTargetIdentifier, source: io.AbsolutePath): Unit
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onCreate(source: io.AbsolutePath): Unit
- def originalInverseSourceItem(source: io.AbsolutePath): Option[io.AbsolutePath]
- def reset(): Unit
- def resetConnections(idToConn: List[(BuildTargetIdentifier, BuildServerConnection)]): Unit
-
def
sbtAutoImports(path: io.AbsolutePath): Option[Seq[String]]
Resolves sbt auto imports if a file belongs to a Sbt build target.
-
def
sbtBuildScalaTarget(file: io.AbsolutePath): Option[BuildTargetIdentifier]
Returns meta build target for
*.sbtor*.scalafiles.Returns meta build target for
*.sbtor*.scalafiles. It selects build target by directory of its connection because*.sbtand*.scalaaren't included insourceFilesset - def scalaTarget(id: BuildTargetIdentifier): Option[ScalaTarget]
- def scalaTargetRoot(buildTarget: BuildTargetIdentifier): Option[io.AbsolutePath]
- def scalaVersion(source: io.AbsolutePath): Option[String]
- def setTables(newTables: Tables): Unit
- def setWorkspaceDirectory(newWorkspace: io.AbsolutePath): Unit
- def sourceBuildTargets(sourceItem: io.AbsolutePath): Iterable[BuildTargetIdentifier]
- def sourceItems: Iterable[io.AbsolutePath]
- def sourceItemsToBuildTargets: Iterator[(io.AbsolutePath, java.lang.Iterable[BuildTargetIdentifier])]
- def sourceJarFile(sourceJarName: String): Option[io.AbsolutePath]
- def sourceRoots: Iterable[io.AbsolutePath]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def targetClassDirectories(id: BuildTargetIdentifier): List[String]
- def targetJarClasspath(id: BuildTargetIdentifier): Option[List[io.AbsolutePath]]
- def targetRoots(buildTarget: BuildTargetIdentifier): List[io.AbsolutePath]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def workspaceDirectory(buildTarget: BuildTargetIdentifier): Option[io.AbsolutePath]