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 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[ScalaTarget]
- def allBuildTargetIds: Seq[BuildTargetIdentifier]
- def allInverseDependencies(target: BuildTargetIdentifier): Set[BuildTargetIdentifier]
- 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:- extract toplevel symbol definitions from the source code. - find a jar file from any classfile that defines one of the toplevel symbols. - find the build target which has that jar file in it's classpath.
Otherwise 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(buildTarget: BuildTargetIdentifier): Option[BuildTarget]
- def inverseDependencyLeaves(target: BuildTargetIdentifier): Set[BuildTargetIdentifier]
- def inverseDependencySource(sourceJar: io.AbsolutePath): Option[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 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 scalaInfo(buildTarget: BuildTargetIdentifier): Option[ScalaBuildTarget]
- def scalaTarget(id: BuildTargetIdentifier): Option[ScalaTarget]
- def scalacOptions(buildTarget: BuildTargetIdentifier): Option[ScalacOptionsItem]
- def scalacOptions: Iterable[ScalacOptionsItem]
- 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 sourceRoots: Iterable[io.AbsolutePath]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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]