Skip to content

Commit b86373b

Browse files
authored
Merge pull request #7664 from dotty-staging/tastydoc
Tastydoc
2 parents 7185680 + 9e4ee9f commit b86373b

File tree

531 files changed

+18567
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

531 files changed

+18567
-10
lines changed

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,37 @@ community-build/sbt-dotty-sbt
8383

8484
# Vulpix output files
8585
*.check.out
86+
87+
tastydoc/report/report\.aux
88+
89+
tastydoc/report/report\.fdb_latexmk
90+
91+
tastydoc/report/report\.fls
92+
93+
tastydoc/report/report\.synctex\.gz
94+
95+
tastydoc/report/report\.toc
96+
97+
tastydoc/report/report\.out
98+
99+
tastydoc/report/presentation/presentation\.aux
100+
101+
tastydoc/report/presentation/presentation\.fdb_latexmk
102+
103+
tastydoc/report/presentation/presentation\.fls
104+
105+
tastydoc/report/presentation/presentation\.nav
106+
107+
tastydoc/report/presentation/presentation\.out
108+
109+
tastydoc/report/presentation/presentation\.snm
110+
111+
tastydoc/report/presentation/presentation\.synctex\.gz
112+
113+
tastydoc/report/presentation/presentation\.toc
114+
115+
tastydoc/dotty-0\.15\.0-RC1/
116+
117+
tastydoc/report/presentation/presentation\.vrb
118+
119+
tastydoc/dotty-0\.16\.0-RC3/

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ val `dotty-bench-bootstrapped` = Build.`dotty-bench-bootstrapped`
1717
val `tasty-core` = Build.`tasty-core`
1818
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
1919
val `tasty-core-scala2` = Build.`tasty-core-scala2`
20+
val `dotty-tastydoc` = Build.`dotty-tastydoc`
21+
val `dotty-tastydoc-input` = Build.`dotty-tastydoc-input`
2022
val `scala-library` = Build.`scala-library`
2123
val `scala-compiler` = Build.`scala-compiler`
2224
val `scala-reflect` = Build.`scala-reflect`

doc-tool/src/dotty/tools/dottydoc/model/comment/Comment.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package comment
66
import dotty.tools.dottydoc.util.syntax._
77
import dotty.tools.dotc.core.Contexts.Context
88
import dotty.tools.dotc.util.Spans._
9-
import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
9+
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode }
1010
import HtmlParsers._
1111
import util.MemberLookup
1212

doc-tool/src/dotty/tools/dottydoc/model/comment/CommentParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import dotty.tools.dotc.printing.Formatting.hl
1111
import scala.collection.mutable
1212
import dotty.tools.dotc.config.Printers.dottydoc
1313
import scala.util.matching.Regex
14-
import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
14+
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode }
1515
import com.vladsch.flexmark.parser.{ Parser => MarkdownParser }
1616

1717
trait CommentParser extends util.MemberLookup {

doc-tool/src/dotty/tools/dottydoc/model/comment/HtmlParsers.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import dotc.util.Spans._
88
import dotty.tools.dottydoc.util.syntax._
99
import util.MemberLookup
1010

11-
import com.vladsch.flexmark.ast.{ Node => MarkdownNode }
11+
import com.vladsch.flexmark.util.ast.{ Node => MarkdownNode}
1212
import com.vladsch.flexmark.html.HtmlRenderer
1313
import com.vladsch.flexmark.parser.Parser
1414
import com.vladsch.flexmark.util.sequence.CharSubSequence
@@ -17,7 +17,9 @@ object HtmlParsers {
1717

1818
implicit class StringToMarkdown(val text: String) extends AnyVal {
1919
def toMarkdown(origin: Entity)(implicit ctx: Context): MarkdownNode = {
20-
import com.vladsch.flexmark.ast.{ Link, Visitor, VisitHandler, NodeVisitor }
20+
import com.vladsch.flexmark.ast.Link
21+
import com.vladsch.flexmark.util.ast.{Visitor, VisitHandler, NodeVisitor }
22+
2123

2224
val inlineToHtml = InlineToHtml(origin)
2325

@@ -149,4 +151,4 @@ object HtmlParsers {
149151
}
150152
}
151153
}
152-
}
154+
}

doc-tool/src/dotty/tools/dottydoc/model/comment/MarkdownShortener.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package comment
1010
* @note calling `shorten` **will** mutate the Markdown AST node.
1111
*/
1212
class MarkdownShortener {
13+
import com.vladsch.flexmark.util.ast._
1314
import com.vladsch.flexmark.ast._
1415

1516
def shorten(node: Node, maxLen: Int = 150): Node = {
@@ -80,4 +81,4 @@ class MarkdownShortener {
8081
nodeVisitor.visit(node)
8182
node
8283
}
83-
}
84+
}

doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownCodeBlockVisitor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dotty.tools
22
package dottydoc
33
package staticsite
44

5+
import com.vladsch.flexmark.util.ast._
56
import com.vladsch.flexmark.ast._
67
import com.vladsch.flexmark.util.sequence.CharSubSequence
78

@@ -16,4 +17,4 @@ object MarkdownCodeBlockVisitor {
1617
})
1718
)
1819
.visit(node)
19-
}
20+
}

doc-tool/src/dotty/tools/dottydoc/staticsite/MarkdownLinkVisitor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package dottydoc
33
package staticsite
44

55
import com.vladsch.flexmark.ast._
6+
import com.vladsch.flexmark.util.ast._
67
import com.vladsch.flexmark.util.sequence.{BasedSequence, CharSubSequence}
78
import model.{Def, Package, TypeAlias, Val}
89
import dottydoc.util.MemberLookup
@@ -42,4 +43,4 @@ object MarkdownLinkVisitor {
4243
})
4344
)
4445
.visit(node)
45-
}
46+
}

project/Build.scala

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,28 @@ object Build {
374374
dottyLib + File.pathSeparator + findArtifactPath(externalDeps, "scala-library")
375375
}
376376

377+
lazy val tastydocSettings = Seq(
378+
baseDirectory in (Compile, run) := baseDirectory.value / "..",
379+
baseDirectory in Test := baseDirectory.value / "..",
380+
libraryDependencies +=
381+
"com.novocode" % "junit-interface" % "0.11",
382+
libraryDependencies ++= {
383+
val flexmarkVersion = "0.42.12"
384+
Seq(
385+
"com.vladsch.flexmark" % "flexmark-all" % flexmarkVersion,
386+
"com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion,
387+
"com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion,
388+
"com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion,
389+
"com.vladsch.flexmark" % "flexmark-ext-anchorlink" % flexmarkVersion,
390+
"com.vladsch.flexmark" % "flexmark-ext-emoji" % flexmarkVersion,
391+
"com.vladsch.flexmark" % "flexmark-ext-gfm-strikethrough" % flexmarkVersion,
392+
"com.vladsch.flexmark" % "flexmark-ext-yaml-front-matter" % flexmarkVersion,
393+
Dependencies.`jackson-dataformat-yaml`,
394+
"nl.big-o" % "liqp" % "0.6.7"
395+
)
396+
}
397+
)
398+
377399
def dottyDocSettings(implicit mode: Mode) = Seq(
378400
baseDirectory in (Compile, run) := baseDirectory.value / "..",
379401
baseDirectory in Test := baseDirectory.value / "..",
@@ -414,9 +436,9 @@ object Build {
414436
}.evaluated,
415437

416438
libraryDependencies ++= {
417-
val flexmarkVersion = "0.28.32"
439+
val flexmarkVersion = "0.42.12"
418440
Seq(
419-
"com.vladsch.flexmark" % "flexmark" % flexmarkVersion,
441+
"com.vladsch.flexmark" % "flexmark-all" % flexmarkVersion,
420442
"com.vladsch.flexmark" % "flexmark-ext-gfm-tasklist" % flexmarkVersion,
421443
"com.vladsch.flexmark" % "flexmark-ext-gfm-tables" % flexmarkVersion,
422444
"com.vladsch.flexmark" % "flexmark-ext-autolink" % flexmarkVersion,
@@ -1021,6 +1043,9 @@ object Build {
10211043
lazy val `dotty-bench` = project.in(file("bench")).asDottyBench(NonBootstrapped)
10221044
lazy val `dotty-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped)
10231045

1046+
lazy val `dotty-tastydoc` = project.in(file("tastydoc")).asDottyTastydoc(Bootstrapped)
1047+
lazy val `dotty-tastydoc-input` = project.in(file("tastydoc/input")).asDottyTastydocInput(Bootstrapped)
1048+
10241049
// Depend on dotty-library so that sbt projects using dotty automatically
10251050
// depend on the dotty-library
10261051
lazy val `scala-library` = project.
@@ -1329,6 +1354,14 @@ object Build {
13291354
settings(commonBenchmarkSettings).
13301355
enablePlugins(JmhPlugin)
13311356

1357+
def asDottyTastydoc(implicit mode: Mode): Project = project.withCommonSettings.
1358+
aggregate(`dotty-tastydoc-input`).
1359+
dependsOn(dottyCompiler).
1360+
settings(tastydocSettings)
1361+
1362+
def asDottyTastydocInput(implicit mode: Mode): Project = project.withCommonSettings.
1363+
dependsOn(dottyCompiler)
1364+
13321365
def asDist(implicit mode: Mode): Project = project.
13331366
enablePlugins(PackPlugin).
13341367
withCommonSettings.

semanticdb/project/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.2.6

tastydoc/TODO.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Comment parsing
2+
## Files from dotty-doc requiring work
3+
* util.traversing
4+
* ImplicitlyAddedFrom
5+
* Fix linking for inherited method
6+
7+
# Other
8+
* Check remaining TODOs/TOASKs/TOFIX
9+
10+
# Representation
11+
* Id for typeparams so we can link (Do not link)
12+
* Alias type
13+
* Rework type matching + Order in type matching symbol counts...
14+
* Remove artifacts in packages => Will fix linking as well
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
dotty
2+
# object DottyPredef
3+
4+
<pre><code class="language-scala" >final object DottyPredef extends Serializable</pre></code>
5+
## Concrete Value Members:
6+
### assert
7+
<pre><code class="language-scala" >@forceInline final def assert(assertion: => Boolean): Unit</pre></code>
8+
9+
### assert
10+
<pre><code class="language-scala" >@forceInline final def assert(assertion: => Boolean, message: => Any): Unit</pre></code>
11+
12+
### assertFail
13+
<pre><code class="language-scala" >def assertFail(message: => Any): Unit</pre></code>
14+
15+
### assertFail
16+
<pre><code class="language-scala" >def assertFail(): Unit</pre></code>
17+
18+
### implicitly
19+
<pre><code class="language-scala" >@forceInline final def implicitly[T](implicit ev: T): T</pre></code>
20+
21+
### locally
22+
<pre><code class="language-scala" >@forceInline def locally[T](body: => T): T</pre></code>
23+
24+
### the
25+
<pre><code class="language-scala" >inline def the[T](x: T): x</pre></code>
26+
27+
### valueOf
28+
<pre><code class="language-scala" >inline def valueOf[T]: T</pre></code>
29+
Retrieve the single value of a type with a unique inhabitant.
30+
31+
***Example***
32+
```scala
33+
object Foo
34+
val foo = valueOf[Foo.type]
35+
// foo is Foo.type = Foo
36+
val bar = valueOf[23]
37+
// bar is 23.type = 23
38+
```
39+
40+
***Group*** utilities
41+

tastydoc/documentation/dotty/dotty.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Package dotty
2+
## Members:
3+
<pre><code class="language-scala" >final object <a href="./DottyPredef$.md">DottyPredef</a></pre></code>
4+
<pre><code class="language-scala" >final val DottyPredef: <a href="./DottyPredef$.md">DottyPredef</a></pre></code>
5+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dotty.internal
2+
# object StringContextMacro
3+
4+
<pre><code class="language-scala" >final object StringContextMacro extends Serializable</pre></code>
5+
## Concrete Value Members:
6+
### f
7+
<pre><code class="language-scala" >inline def f(sc: => StringContext)(args: Seq[Any]): String</pre></code>
8+
Implemetation of scala.StringContext.f used in Dotty while the standard library is still not bootstrapped
9+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Package internal
2+
## Members:
3+
<pre><code class="language-scala" >final object <a href="./StringContextMacro$.md">StringContextMacro</a></pre></code>
4+
<pre><code class="language-scala" >final val StringContextMacro: <a href="./StringContextMacro$.md">StringContextMacro</a></pre></code>
5+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
dotty.runtime
2+
# object Arrays
3+
4+
<pre><code class="language-scala" >final object Arrays extends Serializable</pre></code>
5+
All but the first two operations should be short-circuited and implemented specially by
6+
the backend.
7+
8+
## Concrete Value Members:
9+
### newArray
10+
<pre><code class="language-scala" >def newArray[Arr](componentType: Class[Nothing <: Any], returnType: Class[Arr], dimensions: Array[Int]): Arr</pre></code>
11+
Create an array of a reference type T.
12+
13+
### newGenericArray
14+
<pre><code class="language-scala" >def newGenericArray[T](length: Int)(implicit tag: <a href="../../scala/reflect/ClassTag.md">ClassTag</a>[T]): Array[T]</pre></code>
15+
Creates an array of some element type determined by the given `ClassTag`
16+
argument. The erased type of applications of this method is `Object`.
17+
18+
### seqToArray
19+
<pre><code class="language-scala" >def seqToArray[T](xs: Seq[T], clazz: Class[Nothing <: Any]): Array[T]</pre></code>
20+
Convert a sequence to a Java array with element type given by `clazz`.
21+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
dotty.runtime
2+
# object LazyVals
3+
4+
<pre><code class="language-scala" >final object LazyVals extends Serializable</pre></code>
5+
Helper methods used in thread-safe lazy vals.
6+
7+
## Concrete Type Members:
8+
### Names
9+
<pre><code class="language-scala" >final object <a href="./LazyVals$/Names$.md">Names</a></pre></code>
10+
## Concrete Value Members:
11+
### CAS
12+
<pre><code class="language-scala" >def CAS(t: Object, offset: Long, e: Long, v: Int, ord: Int): Boolean</pre></code>
13+
14+
### STATE
15+
<pre><code class="language-scala" >def STATE(cur: Long, ord: Int): Long</pre></code>
16+
17+
### get
18+
<pre><code class="language-scala" >def get(t: Object, off: Long): Long</pre></code>
19+
20+
### getOffset
21+
<pre><code class="language-scala" >def getOffset(clz: Class[Nothing <: Any], name: String): Long</pre></code>
22+
23+
### setFlag
24+
<pre><code class="language-scala" >def setFlag(t: Object, offset: Long, v: Int, ord: Int): Unit</pre></code>
25+
26+
### wait4Notification
27+
<pre><code class="language-scala" >def wait4Notification(t: Object, offset: Long, cur: Long, ord: Int): Unit</pre></code>
28+
29+
### BITS_PER_LAZY_VAL
30+
<pre><code class="language-scala" >final inline val BITS_PER_LAZY_VAL: 2</pre></code>
31+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
dotty.runtime.LazyVals$
2+
# object Names
3+
4+
<pre><code class="language-scala" >final object Names extends Serializable</pre></code>
5+
## Concrete Value Members:
6+
### cas
7+
<pre><code class="language-scala" >final inline val cas: CAS</pre></code>
8+
9+
### get
10+
<pre><code class="language-scala" >final inline val get: get</pre></code>
11+
12+
### getOffset
13+
<pre><code class="language-scala" >final inline val getOffset: getOffset</pre></code>
14+
15+
### setFlag
16+
<pre><code class="language-scala" >final inline val setFlag: setFlag</pre></code>
17+
18+
### state
19+
<pre><code class="language-scala" >final inline val state: STATE</pre></code>
20+
21+
### wait4Notification
22+
<pre><code class="language-scala" >final inline val wait4Notification: wait4Notification</pre></code>
23+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
dotty.runtime
2+
# class LegacyApp
3+
4+
<pre><code class="language-scala" >class LegacyApp</pre></code>
5+
Replaces the `scala.App` class which relies on `DelayedInit` functionality,
6+
not supported by Dotty.
7+
8+
## Concrete Value Members:
9+
### main
10+
<pre><code class="language-scala" >def main(args: Array[String]): Unit</pre></code>
11+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Package runtime
2+
## Members:
3+
<pre><code class="language-scala" >final object <a href="./Arrays$.md">Arrays</a></pre></code>
4+
All but the first two operations should be short-circuited and implemented specially by
5+
the backend.
6+
7+
<pre><code class="language-scala" >final val Arrays: <a href="./Arrays$.md">Arrays</a></pre></code>
8+
All but the first two operations should be short-circuited and implemented specially by
9+
the backend.
10+
11+
12+
<pre><code class="language-scala" >final object <a href="./LazyVals$.md">LazyVals</a></pre></code>
13+
Helper methods used in thread-safe lazy vals.
14+
15+
<pre><code class="language-scala" >final val LazyVals: <a href="./LazyVals$.md">LazyVals</a></pre></code>
16+
Helper methods used in thread-safe lazy vals.
17+
18+
19+
<pre><code class="language-scala" >class <a href="./LegacyApp.md">LegacyApp</a></pre></code>
20+
Replaces the `scala.App` class which relies on `DelayedInit` functionality,
21+
not supported by Dotty.
22+

0 commit comments

Comments
 (0)