Skip to content

deps(scaladoc): update flexmark from 0.42.12 to 0.62.2 #16846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
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
17 changes: 11 additions & 6 deletions dist/bin/scaladoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,20 @@ classpathArgs () {
CLASS_PATH+="$(find_lib "*tasty-core*")$PSEP"
CLASS_PATH+="$(find_lib "*scala3-tasty-inspector*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-0*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-html-parser*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-anchorlink*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-autolink*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-emoji*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-gfm-strikethrough*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-gfm-tables*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-gfm-tasklist*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-wikilink*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-yaml-front-matter*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-tables*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-ins*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-superscript*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-util-ast*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-util-data*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-util-dependency*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-util-misc*")$PSEP"
CLASS_PATH+="$(find_lib "*liqp*")$PSEP"
CLASS_PATH+="$(find_lib "*jsoup*")$PSEP"
CLASS_PATH+="$(find_lib "*jackson-dataformat-yaml*")$PSEP"
Expand All @@ -80,7 +85,6 @@ classpathArgs () {
CLASS_PATH+="$(find_lib "*jline-reader*")$PSEP"
CLASS_PATH+="$(find_lib "*jline-terminal-3*")$PSEP"
CLASS_PATH+="$(find_lib "*jline-terminal-jna*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-util*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-formatter*")$PSEP"
CLASS_PATH+="$(find_lib "*autolink-0.6*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-jira-converter*")$PSEP"
Expand All @@ -93,9 +97,6 @@ classpathArgs () {
CLASS_PATH+="$(find_lib "*protobuf-java*")$PSEP"
CLASS_PATH+="$(find_lib "*util-interface*")$PSEP"
CLASS_PATH+="$(find_lib "*jna-5*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-tables*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-ins*")$PSEP"
CLASS_PATH+="$(find_lib "*flexmark-ext-superscript*")$PSEP"
CLASS_PATH+="$(find_lib "*antlr4-runtime*")$PSEP"

jvm_cp_args="-classpath \"$CLASS_PATH\""
Expand Down Expand Up @@ -124,6 +125,10 @@ done

classpathArgs

echo "----------"
echo $jvm_cp_args | grep tables
echo "----------"

eval "\"$JAVACMD\"" \
${JAVA_OPTS:-$default_java_opts} \
"${java_args[@]}" \
Expand Down
1 change: 1 addition & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ object Build {
enablePlugins(DottyJSPlugin).
dependsOn(`scala3-library-bootstrappedJS`).
settings(
bspEnabled := false,
scalacOptions --= Seq("-Xfatal-warnings", "-deprecation"),

// Required to run Scala.js tests.
Expand Down
9 changes: 6 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ object Dependencies {
val `jackson-dataformat-yaml` =
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % jacksonVersion

private val flexmarkVersion = "0.42.12"
// Freeze on 0.62.x as 0.64.0 requires Java 11
private val flexmarkVersion = "0.62.2"

val flexmarkDeps = Seq(
"com.vladsch.flexmark" % "flexmark" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-html-parser" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-util-ast" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-util-data" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-util-html" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-anchorlink" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-emoji" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-strikethrough" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-wikilink" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-tables" % flexmarkVersion,
"com.vladsch.flexmark" % "flexmark-ext-yaml-front-matter" % flexmarkVersion,
)

Expand Down
3 changes: 0 additions & 3 deletions project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// Used by VersionUtil to get gitHash and commitDate
libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "4.11.0.201803080745-r"


Compile / unmanagedSourceDirectories +=
baseDirectory.value / "../language-server/src/dotty/tools/languageserver/config"
libraryDependencies += Dependencies.`jackson-databind`
5 changes: 0 additions & 5 deletions scaladoc/src/dotty/tools/scaladoc/DocContext.scala
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
package dotty.tools.scaladoc

import java.io.File
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths

import scala.jdk.CollectionConverters._
import dotty.tools.scaladoc.site.StaticSiteContext
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.util.SourceFile
import dotty.tools.dotc.util.SourcePosition
import dotty.tools.dotc.util.Spans
import java.io.ByteArrayOutputStream
import java.io.PrintStream
import scala.io.Codec
import java.net.URL
import scala.util.Try
import scala.collection.mutable
import dotty.tools.scaladoc.util.Check.checkJekyllIncompatPath

Expand Down
12 changes: 1 addition & 11 deletions scaladoc/src/dotty/tools/scaladoc/Main.scala
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
package dotty.tools.scaladoc

import java.util.ServiceLoader
import java.io.File
import java.util.jar._
import scala.jdk.CollectionConverters._
import collection.immutable.ArraySeq

import java.nio.file.Files

import dotty.tools.dotc.config.Settings._
import dotty.tools.dotc.config.CommonScalaSettings
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.core.Contexts.ContextBase

/** Main class for the doctool when used from cli. */
class Main:
Expand Down
9 changes: 2 additions & 7 deletions scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
package dotty.tools.scaladoc

import java.util.ServiceLoader
import java.io.File
import java.io.FileWriter
import java.util.jar._
import scala.jdk.CollectionConverters._
import collection.immutable.ArraySeq
import java.nio.file.Paths

import java.nio.file.{ Files, Paths }
import collection.immutable.ArraySeq

import dotty.tools.dotc.config.Settings._
import dotty.tools.dotc.config.{ CommonScalaSettings, AllScalaSettings }
import dotty.tools.dotc.reporting.Reporter
import dotty.tools.dotc.core.Contexts._

import dotty.tools.scaladoc.Inkuire
import dotty.tools.scaladoc.Inkuire._

object Scaladoc:
Expand Down
13 changes: 1 addition & 12 deletions scaladoc/src/dotty/tools/scaladoc/ScaladocCommand.scala
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
package dotty.tools.scaladoc

import java.util.ServiceLoader
import java.io.File
import java.util.jar._
import scala.jdk.CollectionConverters._
import collection.immutable.ArraySeq

import java.nio.file.Files

import dotty.tools.dotc.config.Settings._
import dotty.tools.dotc.config.CommonScalaSettings
import dotty.tools.scaladoc.Scaladoc._
import dotty.tools.dotc.config.Settings.Setting.value
import dotty.tools.dotc.config.Properties._
import dotty.tools.dotc.config.CliCommand
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.core.Contexts.Context

object ScaladocCommand extends CliCommand:
type ConcreteSettings = ScaladocSettings
Expand Down
13 changes: 0 additions & 13 deletions scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
package dotty.tools.scaladoc

import java.util.ServiceLoader
import java.io.File
import java.util.jar._
import scala.jdk.CollectionConverters._
import collection.immutable.ArraySeq

import java.nio.file.Files

import dotty.tools.dotc.config.Settings._
import dotty.tools.dotc.config.AllScalaSettings
import dotty.tools.scaladoc.Scaladoc._
import dotty.tools.dotc.config.Settings.Setting.value
import dotty.tools.dotc.config.Properties._
import dotty.tools.dotc.config.CliCommand
import dotty.tools.dotc.core.Contexts._

class ScaladocSettings extends SettingGroup with AllScalaSettings:
val unsupportedSettings = Seq(
Expand Down
4 changes: 0 additions & 4 deletions scaladoc/src/dotty/tools/scaladoc/SocialLinks.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package dotty.tools.scaladoc

import java.nio.file.Path
import java.nio.file.Paths
import dotty.tools.dotc.core.Contexts.Context

enum SocialLinks(val url: String, val className: String):
case Github(ghUrl: String) extends SocialLinks(ghUrl, "gh")
case Twitter(tUrl: String) extends SocialLinks(tUrl, "twitter")
Expand Down
1 change: 0 additions & 1 deletion scaladoc/src/dotty/tools/scaladoc/SourceLinks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dotty.tools.scaladoc

import java.nio.file.Path
import java.nio.file.Paths
import dotty.tools.dotc.core.Contexts.Context
import scala.util.matching.Regex

def pathToString(p: Path) =
Expand Down
3 changes: 1 addition & 2 deletions scaladoc/src/dotty/tools/scaladoc/compat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dotty.tools.scaladoc
import java.util.stream.Stream // comment out - wrong error!
import java.util.stream.Collectors
import java.util.Collections
import java.nio.file.Path
import com.vladsch.flexmark.util.ast.{Node => MdNode}
import dotty.tools.scaladoc.tasty.comments.wiki.WikiDocElement
import scala.jdk.CollectionConverters._
Expand Down Expand Up @@ -37,4 +36,4 @@ extension [V](jlist: JList[V])

extension [V](jset: JSet[V])
def ++ (other: JSet[V]): JSet[V] =
Stream.of(jset, other).flatMap(_.stream).collect(Collectors.toSet())
Stream.of(jset, other).flatMap(_.stream).collect(Collectors.toSet())
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import com.vladsch.flexmark.parser.core._
import com.vladsch.flexmark.parser.block._
import com.vladsch.flexmark.util.ast.Block
import com.vladsch.flexmark.util.ast.BlockContent
import com.vladsch.flexmark.util.options.DataHolder
import com.vladsch.flexmark.util.data.DataHolder
import com.vladsch.flexmark.util.sequence.BasedSequence
import com.vladsch.flexmark.util.sequence.SegmentedSequence

import java.{util => ju}
import ju.regex.Matcher
import ju.regex.Pattern
import scala.jdk.CollectionConverters._


/** Copied from FencedCodeBlockParser. */
Expand All @@ -21,8 +22,11 @@ object WikiCodeBlockParser {
private val CLOSING_FENCE = Pattern.compile("^(\\}{3})(?=[ \t]*$)$")

class Factory extends CustomBlockParserFactory {
override def apply(options: DataHolder): BlockParserFactory =
new WikiCodeBlockParser.BlockFactory(options)

override def getAfterDependents =
new ju.HashSet[Class[_ <: CustomBlockParserFactory]](ju.Arrays.asList(
new ju.HashSet[Class[?]](ju.Arrays.asList(
classOf[BlockQuoteParser.Factory],
classOf[HeadingParser.Factory],
//FencedCodeBlockParser.Factory.class,
Expand All @@ -33,7 +37,7 @@ object WikiCodeBlockParser {
))

override def getBeforeDependents =
new ju.HashSet[Class[_ <: CustomBlockParserFactory]](ju.Arrays.asList(
new ju.HashSet[Class[?]](ju.Arrays.asList(
//BlockQuoteParser.Factory.class,
//HeadingParser.Factory.class,
//FencedCodeBlockParser.Factory.class,
Expand All @@ -44,9 +48,6 @@ object WikiCodeBlockParser {
))

override def affectsGlobalScope = false

override def create(options: DataHolder) =
new WikiCodeBlockParser.BlockFactory(options)
}

private[WikiCodeBlockParser] class BlockFactory (val options: DataHolder)
Expand Down Expand Up @@ -83,7 +84,7 @@ class WikiCodeBlockParser(

final private val block = new FencedCodeBlock()
private var content = new BlockContent
private val codeContentBlock = options.get(Parser.FENCED_CODE_CONTENT_BLOCK)
private val codeContentBlock = Parser.FENCED_CODE_CONTENT_BLOCK.get(options)

def getBlock: Block = block
def getFenceIndent: Int = fenceIndent
Expand Down Expand Up @@ -141,7 +142,7 @@ class WikiCodeBlockParser(
codeBlock.setCharsFromContent
block.appendChild(codeBlock)
} else {
val codeBlock = new Text(SegmentedSequence.of(segments))
val codeBlock = new Text(SegmentedSequence.create(segments.asScala.toSeq:_*))
block.appendChild(codeBlock)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@ package dotty.tools.scaladoc
package renderers

import util.HTML._
import scala.jdk.CollectionConverters._
import java.net.URI
import java.net.URL
import dotty.tools.scaladoc.site._
import scala.util.Try
import org.jsoup.Jsoup
import java.nio.file.Paths
import java.nio.file.Path
import java.nio.file.Files
import java.nio.file.FileVisitOption
import java.io.File
import dotty.tools.scaladoc.staticFileSymbolUUID

class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: DocContext)
extends Renderer(rootPackage, members, extension = "html"):
Expand Down
8 changes: 0 additions & 8 deletions scaladoc/src/dotty/tools/scaladoc/renderers/Locations.scala
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
package dotty.tools.scaladoc
package renderers

import util.HTML._
import scala.jdk.CollectionConverters._
import java.net.URI
import java.net.URL
import dotty.tools.scaladoc.site._
import scala.util.Try
import org.jsoup.Jsoup
import java.nio.file.Paths
import java.nio.file.Path
import java.nio.file.Files
import java.io.File
import scala.util.matching._
import dotty.tools.scaladoc.util.Escape._

val UnresolvedLocationLink = "#"
Expand Down
11 changes: 0 additions & 11 deletions scaladoc/src/dotty/tools/scaladoc/renderers/MarkdownRenderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ package dotty.tools.scaladoc
package renderers

import util.HTML._
import scala.jdk.CollectionConverters._
import java.net.URI
import java.net.URL
import dotty.tools.scaladoc.site._
import scala.util.Try
import org.jsoup.Jsoup
import java.nio.file.Paths
import java.nio.file.Path
import java.nio.file.Files
import java.nio.file.FileVisitOption
import java.io.File

class MarkdownRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: DocContext)
extends Renderer(rootPackage, members, extension = "md"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import util.HTML.{div, *}

import scala.jdk.CollectionConverters.*
import dotty.tools.scaladoc.translators.FilterAttributes
import dotty.tools.scaladoc.tasty.comments.markdown.DocFlexmarkRenderer
import com.vladsch.flexmark.util.ast.Node as MdNode
import dotty.tools.scaladoc.tasty.comments.wiki.WikiDocElement
import org.jsoup.Jsoup
import translators.*

Expand Down
7 changes: 0 additions & 7 deletions scaladoc/src/dotty/tools/scaladoc/renderers/Renderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@ package dotty.tools.scaladoc
package renderers

import util.HTML._
import scala.jdk.CollectionConverters._
import collection.mutable.ListBuffer
import java.net.URI
import java.net.URL
import dotty.tools.scaladoc.site._
import scala.util.Try
import org.jsoup.Jsoup
import java.nio.file.Paths
import java.nio.file.Path
import java.nio.file.Files
import java.nio.file.FileVisitOption
import java.io.File

case class Page(link: Link, content: Member | ResolvedTemplate | String, children: Seq[Page], hidden: Boolean = false):
def withNewChildren(newChildren: Seq[Page]) = copy(children = children ++ newChildren)
Expand Down
Loading