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
- Protected
Type Members
- case class InferredBuildTarget(jar: io.AbsolutePath, symbol: String, id: BuildTargetIdentifier, sourceJar: Option[io.AbsolutePath]) 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 addData(data: TargetData): 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]
- def allWritableData: List[TargetData]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def buildServerOf(id: BuildTargetIdentifier): Option[BuildServerConnection]
- def buildTargetSources(id: BuildTargetIdentifier): Iterable[io.AbsolutePath]
- def buildTargetTransitiveDependencies(ids: List[BuildTargetIdentifier]): Iterable[BuildTargetIdentifier]
- def buildTargetTransitiveDependencies(id: BuildTargetIdentifier): Iterable[BuildTargetIdentifier]
- def buildTargetTransitiveSources(id: BuildTargetIdentifier): Iterator[io.AbsolutePath]
- val buildTargetsOrder: (BuildTargetIdentifier) => Int
- def canCompile(id: BuildTargetIdentifier): Boolean
- def checkIfGeneratedDir(path: io.AbsolutePath): Boolean
- def checkIfGeneratedSource(source: Path): Boolean
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def findByDisplayName(name: String): Option[BuildTarget]
- def fullClasspath(id: BuildTargetIdentifier, cancelPromise: Promise[Unit])(implicit ec: ExecutionContext): Option[Future[List[io.AbsolutePath]]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def inferBuildTarget(toplevels: Iterable[mtags.Symbol]): Option[InferredBuildTarget]
- def inferBuildTarget(source: io.AbsolutePath): Option[BuildTargetIdentifier]
- def inferBuildTargets(source: io.AbsolutePath): List[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 inverseSourcesAll(source: io.AbsolutePath): List[BuildTargetIdentifier]
Returns all build targets containing this source file.
- def inverseSourcesBsp(source: io.AbsolutePath)(implicit ec: ExecutionContext): Future[Option[BuildTargetIdentifier]]
- def inverseSourcesBspAll(source: io.AbsolutePath)(implicit ec: ExecutionContext): Future[List[BuildTargetIdentifier]]
- def isInsideSourceRoot(path: io.AbsolutePath): Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isInverseDependency(query: BuildTargetIdentifier, roots: List[BuildTargetIdentifier]): Boolean
- def isSourceFile(source: io.AbsolutePath): Boolean
- def javaTarget(id: BuildTargetIdentifier): Option[JavaTarget]
- def javaTargetRoot(buildTarget: BuildTargetIdentifier): Option[io.AbsolutePath]
- def jvmTarget(id: BuildTargetIdentifier): Option[JvmTarget]
- def mappedFrom(path: io.AbsolutePath): Option[io.AbsolutePath]
- def mappedLineForClient(mappedPath: io.AbsolutePath, line: Int): Option[Int]
- def mappedLineForServer(mappedPath: io.AbsolutePath, line: Int): Option[Int]
- def mappedTo(path: io.AbsolutePath): Option[MappedSource]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def onCreate(source: io.AbsolutePath): Unit
- def originalInverseSourceItem(source: io.AbsolutePath): Option[io.AbsolutePath]
- def possibleScalaVersions(source: io.AbsolutePath): List[String]
- def removeData(data: TargetData): 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 sourceBuildTargets(sourceItem: io.AbsolutePath): Option[Iterable[BuildTargetIdentifier]]
- def sourceItems: Iterable[io.AbsolutePath]
- def sourceItemsToBuildTargets: Iterator[(io.AbsolutePath, java.lang.Iterable[BuildTargetIdentifier])]
- def sourceJarFor(jar: io.AbsolutePath): Option[io.AbsolutePath]
- def sourceJarFor(id: BuildTargetIdentifier, jar: io.AbsolutePath): 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 targetClasspath(id: BuildTargetIdentifier, cancelPromise: Promise[Unit])(implicit executionContext: ExecutionContext): Option[Future[List[String]]]
- def targetData(id: BuildTargetIdentifier): Option[TargetData]
- 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(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def workspaceDirectory(buildTarget: BuildTargetIdentifier): Option[io.AbsolutePath]
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def sourceJarFile(sourceJarName: String): Option[io.AbsolutePath]
- Annotations
- @deprecated
- Deprecated
This might return false positives since names of jars could repeat.