Skip to content

Commit da8ec20

Browse files
committed
refactor(docs): update the contributing docs
This makes a bunch of small updates the contributing docs that were recently migrated over from the scala-lang site. I think there are actually some more updates to be done, but much of these changes are just structural. To sort of summarize this does the following: - gets rid of old irrelevant things like the `checklist.sh` - removes some instructions that are no longer relevant - re-organizes the side bar to better group things by topic - gets rid of redundant information and tries to group things better - moves the scaladoc docs into the contributing docs I'll add some more comments inline to further explain.
1 parent 261a5ca commit da8ec20

28 files changed

+464
-889
lines changed

docs/_docs/contributing/cheatsheet.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: doc-page
3+
title: Command Cheatsheet
4+
---
5+
6+
## sbt commands
7+
8+
Below is a cheat sheet of some frequently used commands to be used from SBT
9+
console – `sbt`.
10+
11+
12+
| Command | Description |
13+
|------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
14+
| `scala3/scalac` | Run the compiler directly, with any current changes. |
15+
| `scala3/scala` | Run the main method of a given class name. |
16+
| `scalac ../issues/Playground.scala` | Compile the given file – path relative to the Dotty directory. Output the compiled class files to the Dotty directory itself. |
17+
| `scala Playground` | Run the compiled class `Playground`. Dotty directory is on classpath by default. |
18+
| `repl` | Start REPL |
19+
| `scala3/scalac -print-tasty Foo.tasty` | Print the TASTy of top-level class `Foo` |
20+
| `scala3-bootstrapped/test` | Run all tests for Scala 3. (Slow, recommended for CI only) |
21+
| `scala3-bootstrapped/publishLocal` | Build Scala 3 locally. (Use to debug a specific project) |
22+
| `testOnly dotty.tools.dotc.CompilationTests -- *pos` | Run test (method) `pos` from `CompilationTests` suite. |
23+
| `testCompilation sample` | In all test suites, run test files containing the word `sample` in their title. |
24+
| `scala3-compiler/Test/runMain dotty.tools.printTypes`| Print types underlying representation |
25+
| `scaladoc/generateScalaDocumentation` | Build the documentation website (published to https://dotty.epfl.ch) |
26+
| `scaladoc/generateReferenceDocumentation` | Build the reference documentation website (published to https://docs.scala-lang.org/scala3/reference) |
27+
28+
29+
## Shell Commands
30+
31+
Below is a cheat sheet of some frequently used commands to be used from your
32+
shell.
33+
34+
| Command | Description |
35+
|--------------------------------------|------------------------------------------------------------------|
36+
| `rm -rv *.tasty *.class out || true` | clean all compiled artifacts, from root dotty directory |
37+
| `git clean -fdx` | a full clean of all files in the codebase not tracked by git |

docs/_docs/contributing/checklist.sh

Lines changed: 0 additions & 60 deletions
This file was deleted.

docs/_docs/contributing/debug-tests.md

Lines changed: 0 additions & 124 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: doc-page
3+
title: Debugging the Compiler
4+
---
5+
6+
This section goes over the various ways to debug either the compiler or the code
7+
that you're having issues with. This can be just inspecting the trees of your
8+
code or stepping through the dotty codebase with a Debugger.
9+
10+
The following sections will help you with this:
11+
- [Debugging with your IDE](./ide-debugging.md.md)
12+
- [How to Inspect Values](./inspection.md)
13+
- [Other Debugging Techniques](./other-debugging.md)

docs/_docs/contributing/issues/debugging.md renamed to docs/_docs/contributing/debugging/ide-debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: doc-page
3-
title: Debugging the Compiler
3+
title: Debugging with your IDE
44
---
55

66
The debugger is a powerful tool to navigate the internals of the compiler and track bugs.

docs/_docs/contributing/issues/inspection.md renamed to docs/_docs/contributing/debugging/inspection.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ while the compiler is running, and inspect produced artifacts of the compiler.
1111
Frequently you will need to inspect the content of a particular variable.
1212
You can either use `println`s or the debugger, more info on how to setup the latter.
1313

14-
In the remeainder of this article we'll use `println(<someUsefulExpression>)` inserted in the code, but the same effect can be accomplished by stopping at a breakpoint, and typing `<someUsefulExpression>` in the [debug console](./debugging.md#the-debug-console) of the debugger.
14+
In the remainder of this article we'll use `println(<someUsefulExpression>)`
15+
inserted in the code, but the same effect can be accomplished by stopping at a
16+
breakpoint, and typing `<someUsefulExpression>` in the [debug
17+
console](./ide-debugging.md#the-debug-console) of the debugger.
1518

1619
When printing a variable, it's always a good idea to call `show` on that variable: `println(x.show)`.
1720
Many objects of the compiler define `show`, returning a human-readable string.
@@ -102,6 +105,7 @@ If you are curious about the representation of a type, say `[T] =>> List[T]`,
102105
you can use a helper program [dotty.tools.printTypes][DottyTypeStealer],
103106
it prints the internal representation of types, along with their class. It can be
104107
invoked from the sbt shell with three arguments as follows:
108+
105109
```bash
106110
sbt:scala3> scala3-compiler/Test/runMain
107111
dotty.tools.printTypes

0 commit comments

Comments
 (0)