Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions internal/zinc-apiinfo/src/main/scala/xsbt/api/ShowAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ object DefaultShowAPI {
java.lang.Integer.parseInt(sys.props.get("sbt.inc.apidiff.depth").get)
} getOrElse 2

def apply(d: Definition) = ShowAPI.showDefinition(d)(defaultNesting)
def apply(d: Type) = ShowAPI.showType(d)(defaultNesting)
def apply(a: ClassLike) = ShowAPI.showApi(a)(defaultNesting)
def apply(d: Definition) = ShowAPI.showDefinition(d)(using defaultNesting)
def apply(d: Type) = ShowAPI.showType(d)(using defaultNesting)
def apply(a: ClassLike) = ShowAPI.showApi(a)(using defaultNesting)
}

object ShowAPI {
Expand Down Expand Up @@ -192,11 +192,11 @@ object ShowAPI {
}

// limit nesting to prevent cycles and generally keep output from getting humongous
private def showNestedType(tp: Type)(implicit nesting: Int) = showType(tp)(nesting - 1)
private def showNestedType(tp: Type)(implicit nesting: Int) = showType(tp)(using (nesting - 1))
private def showNestedTypeParameter(tp: TypeParameter)(implicit nesting: Int) =
showTypeParameter(tp)(nesting - 1)
showTypeParameter(tp)(using (nesting - 1))
private def showNestedTypeParameters(tps: Seq[TypeParameter])(implicit nesting: Int) =
showTypeParameters(tps)(nesting - 1)
showTypeParameters(tps)(using (nesting - 1))
private def showNestedDefinition(d: Definition)(implicit nesting: Int) =
showDefinition(d)(nesting - 1)
showDefinition(d)(using (nesting - 1))
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import xsbti.compile.{ AnalysisContents, AnalysisStore }
@State(Scope.Benchmark)
class AnalysisFormatBenchmark {

var temp: File = _
var temp: File = compiletime.uninitialized
val sets = IndexedSeq("compiler", "reflect", "library")
var cached: Map[String, AnalysisContents] = _
var cached: Map[String, AnalysisContents] = compiletime.uninitialized

@Setup
def setup(): Unit = {
Expand Down
18 changes: 9 additions & 9 deletions internal/zinc-benchmarks/src/test/scala/xsbt/BenchmarkBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ import xsbti.compile.IncOptions
@State(Scope.Benchmark)
class BenchmarkBase extends BridgeProviderSpecification {
/* Necessary data to run a benchmark. */
@Param(Array("")) var _tempDir: String = _
var _project: BenchmarkProject = _
var _subprojectToRun: String = _
@Param(Array("")) var _tempDir: String = compiletime.uninitialized
var _project: BenchmarkProject = compiletime.uninitialized
var _subprojectToRun: String = compiletime.uninitialized
@Param(Array("true"))
var zincEnabled: Boolean = _
var zincEnabled: Boolean = compiletime.uninitialized

/* Data filled in by the benchmark setup. */
var _dir: File = _
var _setup: ProjectSetup = _
var _compilerSetup: CompilerSetup = _
var _subprojectsSetup: List[ProjectSetup] = _
var _dir: File = compiletime.uninitialized
var _setup: ProjectSetup = compiletime.uninitialized
var _compilerSetup: CompilerSetup = compiletime.uninitialized
var _subprojectsSetup: List[ProjectSetup] = compiletime.uninitialized

/* Java thread affinity (install JNA to run this benchmark). */
var _lock: AffinityLock = _
var _lock: AffinityLock = compiletime.uninitialized

@Setup(Level.Trial)
def setUpCompilerRuns(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sealed trait FileValueCache[T] {
object FileValueCache {
def apply[T](f: Path => T): FileValueCache[T] = make(Stamper.forLastModifiedP)(f)
def make[T](stamp: Path => XStamp)(f: Path => T): FileValueCache[T] =
new FileValueCache0[T](stamp, f)(Equiv.universal)
new FileValueCache0[T](stamp, f)(using Equiv.universal)
}

private final class FileValueCache0[T](getStamp: Path => XStamp, make: Path => T)(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ object Incremental {
earlyOutput,
progress,
log
)(Equiv.universal)
)(using Equiv.universal)
} catch {
case _: xsbti.CompileCancelled =>
log.info("Compilation has been cancelled")
Expand Down Expand Up @@ -979,7 +979,7 @@ private final class AnalysisCallback(

private def addTransitiveBytecodeHash(base: Analysis): Analysis = {
import base.{ apis, relations }
val findUpstream = relations.memberRef.internal.forward _
val findUpstream = relations.memberRef.internal.forward
val internalAPIs = apis.internal.map { case (className, analyzedClass) =>
if (!analyzedClass.hasMacro) {
(className, analyzedClass)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ class ConsistentAnalysisFormat(val mappers: ReadWriteMappers, reproducible: Bool
writeMaybeSortedStringMap(
out,
n,
if (reproducible) m.mapValues(_.withCompilationTimestamp(DefaultCompilationTimestamp))
if (reproducible)
m.view.mapValues(_.withCompilationTimestamp(DefaultCompilationTimestamp)).toMap
else m
) { ac =>
writeAnalyzedClass(out, ac, storeApis)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ class TextAnalysisFormat(val mappers: ReadWriteMappers)
asProduct2(DiagnosticsUtil.diagnosticRelatedInformation)(d => (d.position(), d.message()))
private implicit def problemFormat: Format[Problem] = {
implicit val ev: Format[List[DiagnosticRelatedInformation]] =
listFormat(diagnosticRelatedInformationFormat)
listFormat(using diagnosticRelatedInformationFormat)
implicit val ev2: Format[List[Action]] =
listFormat(actionFormat)
listFormat(using actionFormat)
asProduct8(problem)(p =>
(
p.category,
Expand All @@ -130,7 +130,7 @@ class TextAnalysisFormat(val mappers: ReadWriteMappers)
)
)
private implicit def workspaceEditFormat: Format[WorkspaceEdit] = {
implicit val ev: Format[List[TextEdit]] = listFormat(textEditFormat)
implicit val ev: Format[List[TextEdit]] = listFormat(using textEditFormat)
wrap[WorkspaceEdit, List[TextEdit]](
(e: WorkspaceEdit) => jl2l(e.changes),
InterfaceUtil.workspaceEdit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class IncrementalCompilerImpl extends IncrementalCompiler {
extraOptions,
conv,
stamper.toOption.getOrElse(defaultStampReader),
)(logger)
)(using logger)
}

/**
Expand Down Expand Up @@ -134,7 +134,7 @@ class IncrementalCompilerImpl extends IncrementalCompiler {
extraOptions,
conv,
stamper.toOption.getOrElse(defaultStampReader),
)(logger)
)(using logger)
}

/**
Expand Down Expand Up @@ -224,7 +224,7 @@ class IncrementalCompilerImpl extends IncrementalCompiler {
extraInScala,
converter,
stampReader
)(logger)
)(using logger)
}

/**
Expand Down Expand Up @@ -316,7 +316,7 @@ class IncrementalCompilerImpl extends IncrementalCompiler {
extraInScala,
conveter,
stampReader
)(logger)
)(using logger)
}

/**
Expand Down Expand Up @@ -491,9 +491,9 @@ class IncrementalCompilerImpl extends IncrementalCompiler {
JarUtils.setupTempClassesDir(temporaryClassesDirectory)
val (changed, analysis) =
if (recompileAllJava) {
compileAllJava(MixedAnalyzingCompiler(config)(logger))
compileAllJava(MixedAnalyzingCompiler(config)(using logger))
} else {
compileInternal(MixedAnalyzingCompiler(config)(logger))
compileInternal(MixedAnalyzingCompiler(config)(using logger))
}
CompileResult.of(analysis, currentSetup, changed)
}
Expand Down
Loading