Skip to content

Commit 19f3c63

Browse files
committed
update docs for 3.2.0
1 parent 5b81f19 commit 19f3c63

File tree

60 files changed

+739
-1963
lines changed

Some content is hidden

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

60 files changed

+739
-1963
lines changed

docs/_blog/_posts/2017-05-31-first-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This technology preview demonstrates new language features planned for Scala 3:
7272

7373
We also ship with tools that help you try out the Dotty platform:
7474

75-
- [IDE features for Visual Studio Code](https://dotty.epfl.ch/docs/usage/ide-support.html)
75+
- [IDE features for Visual Studio Code](https://docs.scala-lang.org/scala3/getting-started.html#using-vscode-with-metals)
7676
- [sbt support, including retro-compatibility with Scala 2](https://github.com/lampepfl/dotty-example-project)
7777

7878
See here for the full [release notes](https://dotty.epfl.ch/docs/release-notes/0.1.2.html).

docs/_blog/_posts/2017-07-12-second-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ good the code generated by the Dotty Linker with global analysis disabled:
291291
## How can you try it out?
292292
We ship with tools that help you try out the Dotty platform:
293293

294-
- [IDE features for Visual Studio Code](https://dotty.epfl.ch/docs/usage/ide-support.html)
294+
- [IDE features for Visual Studio Code](https://docs.scala-lang.org/scala3/getting-started.html#using-vscode-with-metals)
295295
- [sbt support, including retro-compatibility with Scala 2](https://github.com/lampepfl/dotty-example-project)
296296

297297

docs/_blog/_posts/2017-09-07-third-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This technology preview further improves stability and reliability. Some highlig
4444
## How can you try it out?
4545
We ship with tools that help you try out the Dotty platform:
4646

47-
- [IDE features for Visual Studio Code](https://dotty.epfl.ch/docs/usage/ide-support.html)
47+
- [IDE features for Visual Studio Code](https://docs.scala-lang.org/scala3/getting-started.html#using-vscode-with-metals)
4848
- [sbt support, including retro-compatibility with Scala 2](https://github.com/lampepfl/dotty-example-project)
4949

5050

docs/_blog/_posts/2017-10-16-fourth-dotty-milestone-release.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ The [new REPL](https://github.com/lampepfl/dotty/pull/2991) instead works by
3636
manipulating ASTs (Abstract Syntax Trees), this is more robust and will make it
3737
easier to develop new features: we have already implemented auto-completion
3838
support (by reusing the APIs we had created for
39-
the [Dotty IDE](https://dotty.epfl.ch/docs/usage/ide-support.html)) and we have
40-
plans for displaying API documentation in the REPL.
39+
the Dotty IDE and we have plans for displaying API documentation in the REPL.
4140

4241
Note that the user interface of the REPL has not changed: like in the old REPL
4342
we use code adapted from the [Ammonite REPL](http://ammonite.io/#Ammonite-REPL)
@@ -77,7 +76,7 @@ using Dotty with sbt, see the
7776

7877
### IDE support
7978
It is very easy to start using the Dotty IDE in any Dotty project by following
80-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
79+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
8180

8281

8382
### Standalone installation

docs/_blog/_posts/2017-12-01-fifth-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ using Dotty with sbt, see the
138138

139139
### IDE support
140140
It is very easy to start using the Dotty IDE in any Dotty project by following
141-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
141+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
142142

143143

144144
### Standalone installation

docs/_blog/_posts/2018-03-05-seventh-dotty-milestone-release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ local and imported definitions. Members completions take possible implicit conve
114114

115115
We also improved the `find references` functionality. It is more robust and much faster!
116116

117-
Try it out in [Visual Studio Code](https://dotty.epfl.ch/docs/usage/ide-support.html)!
117+
Try it out in [Visual Studio Code](https://docs.scala-lang.org/scala3/getting-started.html#using-vscode-with-metals)!
118118

119119
### Better and safer types in pattern matching (improved GADT support)
120120

@@ -204,7 +204,7 @@ using Dotty with sbt, see the
204204

205205
### IDE support
206206
It is very easy to start using the Dotty IDE in any Dotty project by following
207-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
207+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
208208

209209

210210
### Standalone installation

docs/_blog/_posts/2018-04-27-eighth-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ using Dotty with sbt, see the
133133

134134
### IDE support
135135
It is very easy to start using the Dotty IDE in any Dotty project by following
136-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
136+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
137137

138138

139139
### Standalone installation

docs/_blog/_posts/2018-07-06-ninth-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ using Dotty with sbt, see the
117117

118118
### IDE support
119119
Start using the Dotty IDE in any Dotty project by following
120-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
120+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
121121

122122

123123
### Standalone installation

docs/_blog/_posts/2018-10-10-10th-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ using Dotty with Mill, see the
154154
### IDE support
155155

156156
Start using the Dotty IDE in any Dotty project by following
157-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
157+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
158158

159159
### Standalone installation
160160

docs/_blog/_posts/2018-11-30-11th-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ using Dotty with Mill, see the
140140
### IDE support
141141

142142
Start using the Dotty IDE in any Dotty project by following
143-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
143+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
144144

145145
### Standalone installation
146146

docs/_blog/_posts/2019-01-21-12th-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ using Dotty with Mill, see the
131131
### IDE support
132132

133133
Start using the Dotty IDE in any Dotty project by following
134-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
134+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
135135

136136
### Standalone installation
137137

docs/_blog/_posts/2019-03-05-13th-dotty-milestone-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ using Dotty with Mill, see the
354354
## IDE support
355355

356356
Start using the Dotty IDE in any Dotty project by following
357-
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
357+
the IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html).
358358

359359
## Standalone installation
360360

docs/_docs/contributing/debug-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can run `help` for commands that supported by JDB.
3838

3939
Following file (`tests/debug/while.scala`) is an example of annotated source code:
4040

41-
```Scala
41+
```scala
4242
object Test {
4343

4444
def main(args: Array[String]): Unit = {

docs/_docs/contributing/testing.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,9 @@ $ sbt
131131

132132
When the sources of a test consist of multiple source files places in a single directory they are passed to the compiler in a single run and the compiler decides in which order to compile them. In some cases, however, to reproduce a specific test scenario it might be necessary to compile the source files in several steps in a specified order. To achieve that one can add a `_${step_index}` suffix to a file name (before the `.scala` or `.java` extension) indicating the order of compilation. E.g. if the test directory contains files named `Foo_1.scala`, `Bar_2.scala` and `Baz_2.scala` then `Foo_1.scala` will be compiled first and after that `Bar_2.scala` together with `Baz_2.scala`.
133133

134-
There are also other suffixes indicating how some particular files are compiled:
135-
* `_c${compilerVersion}` - compile a file with a specific version of the compiler instead of the one developed on the current branch
136-
(e.g. `Foo_c3.0.2.scala`)
137-
* `_r${release}` - compile a file with a given value of `-scala-output-version` flag (e.g. `Foo_r3.0.scala`)
134+
The other kind of suffix that can modify how particular files are compiled is `_c${compilerVersion}`. When specified, the file will be compiled with a specific version of the compiler instead of the one developed on the current branch.
138135

139-
Different suffixes can be mixed together (their order is not important although consistency is advised), e.g. `Foo_1_r3.0`, `Bar_2_c3.0.2`.
136+
Different suffixes can be mixed together (their order is not important although consistency is advised), e.g. `Foo_1_c3.0.2`, `Bar_2_c3.1.0`.
140137

141138
### Bootstrapped-only tests
142139

docs/_docs/contributing/tools/ide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Using an IDE
44
---
55

66
You can use either Metals (VS Code, vim) or IntelliJ IDEA as described on the
7-
[IDE Support](../../usage/ide-support.md) page to work on the Scala 3 codebase. There are however
8-
a few additional considerations to take into account.
7+
IDE sections of the [getting-started page](https://docs.scala-lang.org/scala3/getting-started.html) to work
8+
on the Scala 3 codebase. There are however a few additional considerations to take into account.
99

1010

1111
## Bootstrapping Projects
@@ -25,8 +25,8 @@ These duplicated projects can be confusing and cause issues in IDEs.
2525

2626
When using Metals, the `-bootstrapped` projects are not exported.
2727

28-
In IntelliJ IDEA, we recommend importing the dotty codebase through BSP as described on the
29-
[IDE Support page](../../usage/ide-support.md), then the `-bootstrapped` projects are not exported.
28+
In IntelliJ IDEA, we recommend importing the dotty codebase through BSP, then the `-bootstrapped`
29+
projects are not exported.
3030

3131

3232
## Scala Version warning in Metals

docs/_docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: index
33
redirectFrom: /docs/index.html
4+
movedTo: https://docs.scala-lang.org/scala3/reference/
45
---
56

67
Dotty is the project name for technologies that are considered for inclusion in Scala 3. Scala has
@@ -15,4 +16,3 @@ be a big step towards realizing the full potential of these ideas. Its main obje
1516

1617
In this documentation you will find information on how to use the Dotty compiler on your machine,
1718
navigate through the code, setup Dotty with your favorite IDE and more!
18-

docs/_docs/internals/backend.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ layout: doc-page
33
title: "Backend Internals"
44
---
55

6-
The code for the backend is split up by functionality and assembled in the
7-
object `GenBCode`.
6+
The code for the JVM backend is split up by functionality and assembled in
7+
`GenBCode.scala`. This file defines class `GenBCode`, the compiler phase.
88

99
```
10-
object GenBCode --- [defines] --> PlainClassBuilder GenBCode also defines class BCodePhase, the compiler phase
10+
class GenBCodePipeline -[defines]--> PlainClassBuilder
1111
| |
1212
[extends] [extends]
1313
| |
@@ -18,34 +18,37 @@ BCodeBodyBuilder ----------------> PlainBodyBuilder
1818
BCodeSkelBuilder ----------------> PlainSkelBuilder
1919
| / | \
2020
BCodeHelpers ----------------> BCClassGen BCAnnotGen ... (more components)
21-
| \ \
22-
| \ \-------------> helper methods
23-
| \ \------------> JMirrorBuilder, JBeanInfoBuilder (uses some components, e.g. BCInnerClassGen)
24-
| \
21+
| | \
22+
| | \-------------> helper methods
23+
| | \------------> JMirrorBuilder, JBeanInfoBuilder (uses some components, e.g. BCInnerClassGen)
24+
| |
2525
| BytecodeWriters ---------> methods and classes to write byte code files
2626
|
27-
BCodeTypes ----------------> maps and fields for common BTypes, class Tracked, methods to collect information on classes, tests for BTypes (conforms), ...
28-
|
2927
BCodeIdiomatic ----------------> utilities for code generation, e.g. genPrimitiveArithmetic
30-
|
31-
BCodeGlue ----------------> BType class, predefined BTypes
28+
\--------------> `bTypes`: maps and fields for common BTypes
3229
```
3330

31+
The `BTypes.scala` class contains the `BType` class and predefined BTypes
32+
3433
### Data Flow ###
35-
Compiler creates a `BCodePhase`, calls `runOn(compilationUnits)`.
34+
Compiler creates a `GenBCode` `Phase`, calls `runOn(compilationUnits)`,
35+
which calls `run(context)`. This:
3636

37-
* initializes fields of `GenBCode` defined in `BCodeTypes` (BType maps,
38-
common BTypes like `StringReference`)
39-
* initialize `primitives` map defined in `scalaPrimitives` (maps primitive
37+
* initializes `myPrimitives` defined in `DottyPrimitives` (maps primitive
4038
members, like `int.+`, to bytecode instructions)
41-
* creates `BytecodeWriter`, `JMirrorBuilder` and `JBeanInfoBuilder` instances
42-
(on each compiler run)
39+
* creates a `GenBCodePipeline` and calls `run(tree)`
40+
41+
`GenBCodePipeline` now:
42+
43+
* initializes the `bTypes` field of `GenBCodePipeline` defined in `BCodeIdiomatic`
44+
(BType maps, common BTypes like `StringRef`)
45+
* creates `BytecodeWriter` and `JMirrorBuilder` instances (on each compiler run)
4346
* `buildAndSendToDisk(units)`: uses work queues, see below.
44-
- `BCodePhase.addToQ1` adds class trees to `q1`
45-
- `Worker1.visit` creates ASM `ClassNodes`, adds to `q2`. It creates one
47+
- `GenBCodePipeline.feedPipeline1` adds ClassDefs to `q1`
48+
- `Worker1.run` creates ASM `ClassNodes`, adds to `q2`. It creates one
4649
`PlainClassBuilder` for each compilation unit.
47-
- `Worker2.addToQ3` adds byte arrays (one for each class) to `q3`
48-
- `BCodePhase.drainQ3` writes byte arrays to disk
50+
- `Worker2.run` adds byte arrays (one for each class) to `q3`
51+
- `GenBCodePipeline.drainQ3` writes byte arrays to disk
4952

5053

5154
### Architecture ###
@@ -110,7 +113,7 @@ To understand how it's built, see:
110113
final def exemplar(csym0: Symbol): Tracked = { ... }
111114
```
112115

113-
Details in `BCodeTypes.scala`
116+
Details in `BTypes.scala`
114117

115118
#### (e) More "high-level" utilities for bytecode emission ####
116119
In the spirit of `BCodeIdiomatic`, utilities are added in `BCodeHelpers` for

docs/_docs/internals/coverage.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: "Code Coverage for Scala 3"
4+
---
5+
6+
## Instrument code for coverage analysis
7+
8+
[PR#13880](https://github.com/lampepfl/dotty/pull/13880) has implemented code coverage support for Dotty.
9+
In general, code coverage "instruments" the program at compile time: code is inserted to record which statement are called. This does not change the behavior of the program. Also, a list of all the coverable statements is produced.
10+
11+
To use this feature, add the compile option `-coverage-out:DIR`, where `DIR` is the destination of the measurement files.
12+
13+
You can also set `-sourceroot:PATHS_ROOT` to customize how the path of your source files are resolved.
14+
Note that `-sourceroot` also sets the root path of the SemanticDB files.
15+
16+
## Details: how the code is instrumented
17+
18+
When the `-coverage-out` option is set, a new phase `instrumentCoverage` runs, just before `firstTransform`.
19+
For a carefully selected list of tree types, it adds a call to `scala.runtime.Invoker.invoked(statementId, DIR)`.
20+
21+
For instance, this code:
22+
```
23+
def method() =
24+
println(f())
25+
```
26+
27+
with `-coverage-out:target/cov` be turned to
28+
```
29+
def method() =
30+
Invoker.invoked(2, "target/cov")
31+
println({
32+
Invoker.invoked(1, "target/cov")
33+
f()
34+
})
35+
```
36+
37+
At the end of the phase, the list of all the instrumented statements is serialized to the file `DIR/scoverage.coverage`.

0 commit comments

Comments
 (0)