Skip to content

Commit 28915c4

Browse files
authored
refactor(docs): update the contributing docs (#17585)
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. [skip community_build] _Old sidebar_ <img width="321" alt="Screenshot 2023-05-25 at 15 18 32" src="https://github.com/lampepfl/dotty/assets/13974112/2e493110-8098-445c-b101-166998c7c95f"> _New sidebar_ <img width="321" alt="Screenshot 2023-05-25 at 15 18 03" src="https://github.com/lampepfl/dotty/assets/13974112/2f86764e-bc3e-4356-9f56-006197a10153">
1 parent ceca748 commit 28915c4

28 files changed

+490
-786
lines changed

docs/_docs/contributing/cheatsheet.md

+37
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

-60
This file was deleted.

docs/_docs/contributing/debug-tests.md

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

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

+1-1
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: doc-page
33
title: How to Inspect Values
4+
redirectFrom: /docs/contributing/issues/inspection.html
45
---
56

67
In this section, you will find out how to debug the contents of certain objects
@@ -11,7 +12,10 @@ while the compiler is running, and inspect produced artifacts of the compiler.
1112
Frequently you will need to inspect the content of a particular variable.
1213
You can either use `println`s or the debugger, more info on how to setup the latter.
1314

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

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

0 commit comments

Comments
 (0)