Skip to content

fix #10138: trim trailing whitespace #10144

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 1 commit into from
Nov 2, 2020
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
2 changes: 1 addition & 1 deletion scala3doc/dotty-docs/docs/_layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
window.scrollTo(0, $(window.location.hash).offset().top - 90);
}
})
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ to make sure that our regression suite includes your library.
[@Blaisorblade]: https://github.com/Blaisorblade
[@Duhemm]: https://github.com/Duhemm
[@AleksanderBG]: https://github.com/AleksanderBG
[@milessabin]: https://github.com/milessabin
[@milessabin]: https://github.com/milessabin
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ If you know anything useful at all about Dotty, feel free to log this knowledge:
- [📜Log the Knowledge](https://github.com/lampepfl/dotty-knowledge/issues/new)
- [🎓More about Logging the Knowledge](https://github.com/lampepfl/dotty-knowledge/blob/master/README.md)

In short, no need to make it pretty, particularly human-readable or give it a particular structure. Just dump the knowledge you have and we'll take it from there.
In short, no need to make it pretty, particularly human-readable or give it a particular structure. Just dump the knowledge you have and we'll take it from there.
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ git checkout master

git commit -am 'Set baseVersion to 0.16.0'
git push origin master
```
```
6 changes: 3 additions & 3 deletions scala3doc/dotty-docs/docs/docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Running all tests in Dotty is as simple as:
$ sbt test
```

Specifically, `sbt test` runs all tests that do _not_ require a bootstrapped
compiler. In practice, this means that it runs all compilation tests meeting
this criterion, as well as all non-compiler tests.
Specifically, `sbt test` runs all tests that do _not_ require a bootstrapped
compiler. In practice, this means that it runs all compilation tests meeting
this criterion, as well as all non-compiler tests.

The entire suite of tests can be run using the bootstrapped compiler as follows:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ def foo(f: Foo) = f match {
```

There are plans for further simplification, in particular to factor out *product
match* and *name-based match* into a single type of extractor.
match* and *name-based match* into a single type of extractor.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def extension_position(s: String)(ch: Char, n: Int): Int =
extension (x: Double) def ** (exponent: Int): Double =
require(exponent >= 0)
if exponent == 0 then 1 else x * (x ** (exponent - 1))

import DoubleOps.{**, extension_**}
assert(2.0 ** 3 == extension_**(2.0)(3))
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: doc-page
title: Dropped: Scala 2 Macros
---

The previous, experimental macro system has been dropped. Instead, there is a cleaner, more restricted system based on two complementary concepts: `inline` and `'{ ... }`/`${ ... }` code generation.
The previous, experimental macro system has been dropped. Instead, there is a cleaner, more restricted system based on two complementary concepts: `inline` and `'{ ... }`/`${ ... }` code generation.
`'{ ... }` delays the compilation of the code and produces an object containing the code, dually `${ ... }` evaluates an expression which produces code and inserts it in the surrounding `${ ... }`.
In this setting, a definition marked as inlined containing a `${ ... }` is a macro, the code inside the `${ ... }` is executed at compile-time and produces code in the form of `'{ ... }`.
Additionally, the contents of code can be inspected and created with a more complex reflection API (TASTy Reflect) as an extension of `'{ ... }`/`${ ... }` framework.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ Some existing programs will break and, given the complex nature of type inferenc

In our experience, macros and changes in type and implicit argument inference together cause the large majority of problems encountered when porting existing code to Scala 3. The latter source of problems could be addressed systematically by a tool that added all inferred types and implicit arguments to a Scala 2 source code file. Most likely such a tool would be implemented as a Scala 2 compiler plugin. The resulting code would have a greatly increased likelihood to compile under Scala 3, but would often be bulky to the point of being unreadable. A second part of the rewriting tool should then selectively and iteratively remove type and implicit annotations that were synthesized by the first part as long as they compile under Scala 3. This second part could be implemented as a program that invokes the Scala 3 compiler `dotc` programmatically.

Several people have proposed such a tool for some time now. I believe it is time we find the will and the resources to actually implement it.
Several people have proposed such a tool for some time now. I believe it is time we find the will and the resources to actually implement it.
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ val obj2 = choose(false) // static type is B
// obj1.m() // compile-time error: `m` is not defined on `A`
obj2.m() // OK
```
Here, the inline method `choose` returns an instance of either of the two types `A` or `B`.
Here, the inline method `choose` returns an instance of either of the two types `A` or `B`.
If `choose` had not been declared to be `transparent`, the result
of its expansion would always be of type `A`, even though the computed value might be of the subtype `B`.
The inline method is a "blackbox" in the sense that details of its implementation do not leak out.
of its expansion would always be of type `A`, even though the computed value might be of the subtype `B`.
The inline method is a "blackbox" in the sense that details of its implementation do not leak out.
But if a `transparent` modifier is given, the expansion is the type of the expanded body. If the argument `b`
is `true`, that type is `A`, otherwise it is `B`. Consequently, calling `m` on `obj2`
type-checks since `obj2` has the same type as the expansion of `choose(false)`, which is `B`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test(x: A | B) = x.hello // error: value `hello` is not a member of A | B
On the otherhand, the following would be allowed
```scala
trait C { def hello: String }
trait A extends C with D
trait A extends C with D
trait B extends C with E

def test(x: A | B) = x.hello // ok as `hello` is a member of the join of A | B which is C
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ val xs2 = construct[Coll = List](1, 2, 3)

Similar to a named value argument `(x = e)`, a named type argument
`[X = T]` instantiates the type parameter `X` to the type `T`.
Named type arguments do not have to be in order (see `xs1` above) and
Named type arguments do not have to be in order (see `xs1` above) and
unspecified arguments are inferred by the compiler (see `xs2` above).
Type arguments must be all named or un-named, mixtures of named and
positional type arguments are not supported.
Expand Down
6 changes: 3 additions & 3 deletions scala3doc/dotty-docs/docs/docs/reference/soft-modifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Soft Modifiers
---

A soft modifier is one of the identifiers `opaque` and `inline`.
<!--
TODO this is most likely outdated should at least contain `extension` in addition.
Worth maintaining? or maybe better refer to internal/syntax.md ?
<!--
TODO this is most likely outdated should at least contain `extension` in addition.
Worth maintaining? or maybe better refer to internal/syntax.md ?
-->

It is treated as a potential modifier of a definition, if it is followed by a hard modifier or a keyword combination starting a definition (`def`, `val`, `var`, `type`, `class`, `case class`, `trait`, `object`, `case object`, `enum`). Between the two words there may be a sequence of newline tokens and soft modifiers.
Expand Down
34 changes: 17 additions & 17 deletions scala3doc/dotty-docs/docs/docs/resources/talks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Talks on Dotty

- (JVMLS 2015) [Compilers are Databases](https://www.youtube.com/watch?v=WxyyJyB_Ssc) by [Martin Odersky](http://twitter.com/odersky) [\[slides\]](http://www.slideshare.net/Odersky/compilers-are-databases)

- (Scala World 2015) [Dotty: Exploring the future of Scala](https://www.youtube.com/watch?v=aftdOFuVU1o) by [Dmitry Petrashko](http://twitter.com/darkdimius) [\[slides\]](https://d-d.me/scalaworld2015/#/).
Dmitry covers many of the new features that Dotty brings on the table such as Intersection and Union types, improved lazy val initialization and more.
Dmitry also covers dotty internals and in particular the high-level of contextual abstractions of Dotty. You will get to
become familiar with many core concepts such as `Denotations`, their evolution through (compilation) time, their
- (Scala World 2015) [Dotty: Exploring the future of Scala](https://www.youtube.com/watch?v=aftdOFuVU1o) by [Dmitry Petrashko](http://twitter.com/darkdimius) [\[slides\]](https://d-d.me/scalaworld2015/#/).
Dmitry covers many of the new features that Dotty brings on the table such as Intersection and Union types, improved lazy val initialization and more.
Dmitry also covers dotty internals and in particular the high-level of contextual abstractions of Dotty. You will get to
become familiar with many core concepts such as `Denotations`, their evolution through (compilation) time, their
transformations and more.

Deep Dive with Dotty
Expand All @@ -23,7 +23,7 @@ Deep Dive with Dotty

- (ScalaDays 2019, Lausanne) [Future-proofing Scala: the TASTY intermediate representation](https://www.youtube.com/watch?v=zQFjC3zLYwo) by [Guillaume Martres](http://guillaume.martres.me/).

- (Mar 21, 2017) [Dotty Internals 1: Trees & Symbols](https://www.youtube.com/watch?v=yYd-zuDd3S8) by [Dmitry Petrashko](http://twitter.com/darkdimius) [\[meeting notes\]](../internals/dotty-internals-1-notes.md).
- (Mar 21, 2017) [Dotty Internals 1: Trees & Symbols](https://www.youtube.com/watch?v=yYd-zuDd3S8) by [Dmitry Petrashko](http://twitter.com/darkdimius) [\[meeting notes\]](../internals/dotty-internals-1-notes.md).
This is a recorded meeting between EPFL and Waterloo, where we introduce first notions inside Dotty: Trees and Symbols.

- (Mar 21, 2017) [Dotty Internals 2: Types](https://www.youtube.com/watch?v=3gmLIYlGbKc) by [Martin Odersky](http://twitter.com/odersky) and [Dmitry Petrashko](http://twitter.com/darkdimius).
Expand All @@ -36,26 +36,26 @@ This is a recorded meeting between EPFL and Waterloo, where we introduce denotat
[Dmitry Petrashko](http://twitter.com/darkdimius) gives a high-level introduction on what was done to make Dotty .


- (Typelevel Summit Oslo, May 2016) [Dotty and types: the story so far](https://www.youtube.com/watch?v=YIQjfCKDR5A) by
- (Typelevel Summit Oslo, May 2016) [Dotty and types: the story so far](https://www.youtube.com/watch?v=YIQjfCKDR5A) by
Guillaume Martres [\[slides\]](http://guillaume.martres.me/talks/typelevel-summit-oslo/).
Guillaume focused on some of the practical improvements to the type system that Dotty makes, like the new type parameter
Guillaume focused on some of the practical improvements to the type system that Dotty makes, like the new type parameter
inference algorithm that is able to reason about the type safety of more situations than scalac.

- (flatMap(Oslo) 2016) [AutoSpecialization in Dotty](https://vimeo.com/165928176) by [Dmitry Petrashko](http://twitter.com/darkdimius) [\[slides\]](https://d-d.me/talks/flatmap2016/#/).
The Dotty Linker analyses your program and its dependencies to
apply a new specialization scheme. It builds on our experience from Specialization, Miniboxing and the Valhalla Project,
and drastically reduces the size of the emitted bytecode. And, best of all, it's always enabled, happens behind the
- (flatMap(Oslo) 2016) [AutoSpecialization in Dotty](https://vimeo.com/165928176) by [Dmitry Petrashko](http://twitter.com/darkdimius) [\[slides\]](https://d-d.me/talks/flatmap2016/#/).
The Dotty Linker analyses your program and its dependencies to
apply a new specialization scheme. It builds on our experience from Specialization, Miniboxing and the Valhalla Project,
and drastically reduces the size of the emitted bytecode. And, best of all, it's always enabled, happens behind the
scenes without annotations, and results in speedups in excess of 20x. Additionally, it "just works" on Scala collections.

- (ScalaSphere 2016) [Hacking on Dotty: A live demo](https://www.youtube.com/watch?v=0OOYGeZLHs4) by Guillaume Martres [\[slides\]](http://guillaume.martres.me/talks/dotty-live-demo/).
Guillaume hacks on Dotty: a live demo during which he
Guillaume hacks on Dotty: a live demo during which he
creates a simple compiler phase to trace method calls at run-time.

- (Scala By the Bay 2016) [Dotty: what is it and how it works](https://www.youtube.com/watch?v=wCFbYu7xEJA) by Guillaume
Martres [\[slides\]](http://guillaume.martres.me/talks/dotty-tutorial/#/). Guillaume provides a high-level view of the
- (Scala By the Bay 2016) [Dotty: what is it and how it works](https://www.youtube.com/watch?v=wCFbYu7xEJA) by Guillaume
Martres [\[slides\]](http://guillaume.martres.me/talks/dotty-tutorial/#/). Guillaume provides a high-level view of the
compilation-pipeline of Dotty.

- (ScalaDays 2015, Amsterdam) [Making your Scala applications smaller and faster with the Dotty linker](https://www.youtube.com/watch?v=xCeI1ArdXM4) by Dmitry Petrashko [\[slides\]](https://d-d.me/scaladays2015/#/).
Dmitry introduces the call-graph analysis algorithm
that Dotty implements and the performance benefits we can get in terms of number of methods, bytecode size, JVM code size
- (ScalaDays 2015, Amsterdam) [Making your Scala applications smaller and faster with the Dotty linker](https://www.youtube.com/watch?v=xCeI1ArdXM4) by Dmitry Petrashko [\[slides\]](https://d-d.me/scaladays2015/#/).
Dmitry introduces the call-graph analysis algorithm
that Dotty implements and the performance benefits we can get in terms of number of methods, bytecode size, JVM code size
and the number of objects allocated in the end.
2 changes: 1 addition & 1 deletion scala3doc/dotty-docs/docs/js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scala3doc/dotty-docs/docs/js/highlight.pack.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scala3doc/resources/dotty_res/hljs/highlight.pack.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class DocumentableList extends Component {
}
}

class List {
filterTab(name) {
class List {
filterTab(name) {
return name !== "Linear supertypes" && name !== "Known subtypes" && name !== "Type hierarchy"
}

Expand Down
6 changes: 3 additions & 3 deletions scala3doc/resources/dotty_res/scripts/diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ $("#inheritance-diagram").ready(function() {
if (dotNode){
var svg = d3.select("#graph");
var inner = svg.append("g");

// Set up zoom support
var zoom = d3.zoom()
.on("zoom", function({transform}) {
inner.attr("transform", transform);
});
svg.call(zoom);

var render = new dagreD3.render();
var g = graphlibDot.read(dotNode.text);
g.graph().rankDir = 'BT';
g.nodes().forEach(function (v) {
g.setNode(v, {
g.setNode(v, {
labelType: "html",
label: g.node(v).label,
style: g.node(v).style
Expand Down
2 changes: 1 addition & 1 deletion scala3doc/src/dotty/dokka/DottyDokkaConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ case class DottyDokkaConfig(docConfiguration: DocConfiguration) extends DokkaCon

override def getPluginsConfiguration: JList[DokkaConfiguration.PluginConfiguration] = List(OurConfig).asJava

def mkSourceSet: DokkaConfiguration.DokkaSourceSet =
def mkSourceSet: DokkaConfiguration.DokkaSourceSet =
val sourceLinks:Set[SourceLinkDefinitionImpl] = docConfiguration.args.sourceLinks.map(SourceLinkDefinitionImpl.Companion.parseSourceLinkDefinition(_)).toSet
new DokkaSourceSetImpl(
/*displayName=*/ docConfiguration.args.name,
Expand Down
24 changes: 12 additions & 12 deletions scala3doc/src/dotty/dokka/DottyDokkaPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
_.extensionPoint(CoreExtensions.INSTANCE.getSourceToDocumentableTranslator)
.fromInstance(EmptyModuleProvider)
.overrideExtension(dokkaBase.getPsiToDocumentableTranslator)
)
)

// Just turn off another translator since multiple overrides does not work
// Just turn off another translator since multiple overrides does not work
val disableDescriptorTranslator = extend(
_.extensionPoint(CoreExtensions.INSTANCE.getSourceToDocumentableTranslator)
.fromInstance(ScalaModuleProvider)
.overrideExtension(dokkaBase.getDescriptorToDocumentableTranslator)
.name("disableDescriptorTranslator")
)
)

// Clean up empty module provided in disableDescriptorTranslator
val cleanUpEmptyModules = extend(
Expand All @@ -65,20 +65,20 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
.fromRecipe(ctx =>
new ScalaSignatureProvider(ctx.single(dokkaBase.getCommentsToContentConverter), ctx.getLogger)
).overrideExtension(dokkaBase.getKotlinSignatureProvider)
)
)

val scalaResourceInstaller = extend(
_.extensionPoint(dokkaBase.getHtmlPreprocessors)
.fromInstance(new ScalaResourceInstaller())
.after(dokkaBase.getCustomResourceInstaller)
)
)

val scalaEmbeddedResourceAppender = extend(
_.extensionPoint(dokkaBase.getHtmlPreprocessors)
.fromInstance(new ScalaEmbeddedResourceAppender())
.after(dokkaBase.getCustomResourceInstaller)
.name("scalaEmbeddedResourceAppender")
)
)

val scalaDocumentableToPageTranslator = extend(
_.extensionPoint(CoreExtensions.INSTANCE.getDocumentableToPageTranslator)
Expand All @@ -88,19 +88,19 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
ctx.getLogger
))
.overrideExtension(dokkaBase.getDocumentableToPageTranslator)
)
)

val packageHierarchyTransformer = extend(
_.extensionPoint(CoreExtensions.INSTANCE.getPageTransformer)
.fromRecipe(PackageHierarchyTransformer(_))
.before(dokkaBase.getRootCreator)
)
)

val inheritanceTransformer = extend(
_.extensionPoint(CoreExtensions.INSTANCE.getDocumentableTransformer)
.fromRecipe(InheritanceInformationTransformer(_))
.name("inheritanceTransformer")
)
)

val ourSourceLinksTransformer = extend(
_.extensionPoint(CoreExtensions.INSTANCE.getDocumentableTransformer)
Expand All @@ -123,7 +123,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
_.extensionPoint(dokkaBase.getCommentsToContentConverter)
.fromInstance(ScalaCommentToContentConverter)
.overrideExtension(dokkaBase.getDocTagToContentConverter)
)
)

val implicitMembersExtensionTransformer = extend(
_.extensionPoint(CoreExtensions.INSTANCE.getDocumentableTransformer )
Expand All @@ -138,12 +138,12 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
})
.overrideExtension(dokkaBase.getSourceLinksTransformer)
.name("muteDefaultSourceLinksTransformer")
)
)

// TODO remove once problem is fixed in Dokka
extension [T] (builder: ExtensionBuilder[T]):
def before(exts: Extension[_, _, _]*): ExtensionBuilder[T] =
(new ExtensionBuilderEx).newOrdering(builder, exts.toArray, Array.empty)

def after(exts: Extension[_, _, _]*): ExtensionBuilder[T] =
(new ExtensionBuilderEx).newOrdering(builder, Array.empty, exts.toArray)
(new ExtensionBuilderEx).newOrdering(builder, Array.empty, exts.toArray)
2 changes: 1 addition & 1 deletion scala3doc/src/dotty/dokka/IO.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public FileVisitResult visitFile(
}
});
}
}
}
2 changes: 1 addition & 1 deletion scala3doc/src/dotty/dokka/ScalaModuleCreator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ object ScalaModuleProvider extends JavaSourceToDocumentableTranslator:

object EmptyModuleProvider extends JavaSourceToDocumentableTranslator:
override def process(sourceSet: DokkaSourceSet, context: DokkaContext) =
DModule("", Nil.asJava, Map.empty.asJava, null, Set(sourceSet).asJava, PropertyContainer.Companion.empty())
DModule("", Nil.asJava, Map.empty.asJava, null, Set(sourceSet).asJava, PropertyContainer.Companion.empty())
Loading