|
1 |
| -# SemanticDB |
| 1 | +# Tastydoc |
2 | 2 |
|
3 |
| -To run the tests use two terminals. In the first terminal compile the |
4 |
| -`semanticdb/input` project whenever sources change in |
5 |
| -`semanticdb/input/src/main/scala/**.scala`. |
| 3 | +This tool produces Markdown documentation files for Scala projects using TASTy files. |
6 | 4 |
|
7 |
| -``` |
8 |
| -cd semanticdb/input |
9 |
| -sbt |
10 |
| -> compile |
11 |
| -``` |
12 |
| - |
13 |
| -In the second terminal, run `sbt dotty-semanticdb/test` from the main dotty |
14 |
| -build |
15 |
| - |
16 |
| -``` |
17 |
| -sbt |
18 |
| -> dotty-semanticdb/test |
19 |
| -``` |
20 |
| - |
21 |
| -The tests assert that the TASTy to SemanticDB converter produces the same output |
22 |
| -as the semanticdb-scalac compiler plugin. Test failures result in diffs like |
23 |
| -this |
24 |
| - |
25 |
| -```diff |
26 |
| -Test dotty.semanticdb.Tests.testExample failed: java.lang.AssertionError: |
27 |
| ---- tasty |
28 |
| -+++ scala2 |
29 |
| --class Example { |
30 |
| -- val a: String = "1" |
31 |
| -+class Example /*example/Example#*/ { |
32 |
| -+ val a /*example/Example#a.*/ : String /*scala/Predef.String#*/ = "1" |
33 |
| -``` |
34 |
| - |
35 |
| -The lines starting with `-` are the output from the TASTy converter and the |
36 |
| -lines starting with `+` are the output from the semanticdb-scalac compiler |
37 |
| -plugin. |
38 |
| - |
39 |
| -Once the TASTy converter is updated to emit correct `SymbolOccurrence` |
40 |
| -(https://scalameta.org/docs/semanticdb/specification.html#symboloccurrence) then |
41 |
| -the "tasty" output should become identical to "scala2" and include inline |
42 |
| -comments `class Example /* pkg/Example# */`. The inline comments are read as: |
43 |
| -"the symbol `pkg/Example#` was resolved next to the class name `Example`". |
44 |
| - |
45 |
| -The spec for SemanticDB symbols can be found here: |
46 |
| - |
47 |
| -- Scala symbols: |
48 |
| - https://scalameta.org/docs/semanticdb/specification.html#scala-symbol |
49 |
| -- Java symbols: |
50 |
| - https://scalameta.org/docs/semanticdb/specification.html#java-symbol |
| 5 | +## How to run |
| 6 | +Call main with the following arguments to produce Markdown documentation files: (Omitting { and }) |
| 7 | +* **-syntax** {*wiki or markdown*} Syntax for parsing user documentation |
| 8 | +* **-packagestolink** {*regex1 regex2 ...*} Regexes to specify which packages should be linked when formatting Reference |
| 9 | +* **-classpath** {*URI*} Extra classpath for input files |
| 10 | +* **-i** {*file1 file2 ...*} TASTy files |
| 11 | +* **-d** {*dir1 dir2 ...*} Directories to recursively find TASTy files |
0 commit comments