Skip to content

Commit

Permalink
don't specify rangepos, use the compiler's default
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Mar 12, 2021
1 parent f8aed6b commit 4c9d2f4
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 26 deletions.
18 changes: 0 additions & 18 deletions src/test/scala/com/typesafe/genjavadoc/RangePosSpec.scala

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/scala/com/typesafe/genjavadoc/SignatureSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SignatureSpec {
val scalac = new GenJavadocCompiler(Seq(
s"genjavadoc:out=$docPath",
"genjavadoc:suppressSynthetic=false"
), rangepos = true)
))

val javaSources = expectedClasses.map{cls =>
docPath + "/" + cls.replace(".", "/") + ".java"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ trait CompilerSpec {
/** Extra plugin arguments. */
def extraSettings: Seq[String] = Seq.empty

/** whether to enable -Yrangepos */
def rangepos: Boolean = true

@Test def compileSourcesAndGenerateExpectedOutput(): Unit = {
val doc = IO.tempDir("java")
val docPath = doc.getAbsolutePath
val defaultSettings = Seq(s"out=$docPath", "suppressSynthetic=false")
val scalac = new GenJavadocCompiler((defaultSettings ++ extraSettings).map{ kv =>
s"genjavadoc:$kv"
}, rangepos)
})

scalac.compile(sources)
assertFalse("Scala compiler reported errors", scalac.reporter.hasErrors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import scala.tools.nsc.{Global, Settings}
/** An instance of the Scala compiler with the genjavadoc plugin enabled
* @param pluginOptions additional parameters to pass to the compiler
*/
class GenJavadocCompiler(pluginOptions: Seq[String], rangepos: Boolean) {
class GenJavadocCompiler(pluginOptions: Seq[String]) {

private val settings = new Settings

settings.Yrangepos.value = rangepos

val reporter = new ConsoleReporter(settings)
private val global = new Global(settings, reporter) {
override protected def loadRoughPluginsList() =
Expand Down

0 comments on commit 4c9d2f4

Please sign in to comment.