Skip to content

refactor(docs): update the contributing docs #17585

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

Merged
merged 3 commits into from
May 30, 2023
Merged
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
37 changes: 37 additions & 0 deletions docs/_docs/contributing/cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
layout: doc-page
title: Command Cheatsheet
---

## sbt commands

Below is a cheat sheet of some frequently used commands to be used from SBT
console – `sbt`.


| Command | Description |
|------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `scala3/scalac` | Run the compiler directly, with any current changes. |
| `scala3/scala` | Run the main method of a given class name. |
| `scalac ../issues/Playground.scala` | Compile the given file – path relative to the Dotty directory. Output the compiled class files to the Dotty directory itself. |
| `scala Playground` | Run the compiled class `Playground`. Dotty directory is on classpath by default. |
| `repl` | Start REPL |
| `scala3/scalac -print-tasty Foo.tasty` | Print the TASTy of top-level class `Foo` |
| `scala3-bootstrapped/test` | Run all tests for Scala 3. (Slow, recommended for CI only) |
| `scala3-bootstrapped/publishLocal` | Build Scala 3 locally. (Use to debug a specific project) |
| `testOnly dotty.tools.dotc.CompilationTests -- *pos` | Run test (method) `pos` from `CompilationTests` suite. |
| `testCompilation sample` | In all test suites, run test files containing the word `sample` in their title. |
| `scala3-compiler/Test/runMain dotty.tools.printTypes`| Print types underlying representation |
| `scaladoc/generateScalaDocumentation` | Build the documentation website (published to https://dotty.epfl.ch) |
| `scaladoc/generateReferenceDocumentation` | Build the reference documentation website (published to https://docs.scala-lang.org/scala3/reference) |


## Shell Commands

Below is a cheat sheet of some frequently used commands to be used from your
shell.

| Command | Description |
|--------------------------------------|------------------------------------------------------------------|
| `rm -rv *.tasty *.class out || true` | clean all compiled artifacts, from root dotty directory |
| `git clean -fdx` | a full clean of all files in the codebase not tracked by git |
60 changes: 0 additions & 60 deletions docs/_docs/contributing/checklist.sh

This file was deleted.

124 changes: 0 additions & 124 deletions docs/_docs/contributing/debug-tests.md

This file was deleted.

14 changes: 14 additions & 0 deletions docs/_docs/contributing/debugging/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: doc-page
title: Debugging the Compiler
redirectFrom: /docs/contributing/issues/debugging.html
---

This section goes over the various ways to debug either the compiler or the code
that you're having issues with. This can be just inspecting the trees of your
code or stepping through the dotty codebase with a Debugger.

The following sections will help you with this:
- [Debugging with your IDE](./ide-debugging.md.md)
- [How to Inspect Values](./inspection.md)
- [Other Debugging Techniques](./other-debugging.md)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: doc-page
title: Debugging the Compiler
title: Debugging with your IDE
---

The debugger is a powerful tool to navigate the internals of the compiler and track bugs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: doc-page
title: How to Inspect Values
redirectFrom: /docs/contributing/issues/inspection.html
---

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

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.
In the remainder 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](./ide-debugging.md#the-debug-console) of the debugger.

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

```bash
sbt:scala3> scala3-compiler/Test/runMain
dotty.tools.printTypes
Expand Down
Loading