Skip to content

Commit

Permalink
Docs: Fix code formatting in Scaladoc
Browse files Browse the repository at this point in the history
  • Loading branch information
raquo committed Jan 16, 2025
1 parent c3bc01d commit 83ee60e
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import scala.quoted.Varargs
import com.raquo.airstream.split.MacrosUtilities.{CaseAny, HandlerAny, MatchTypeHandler, MatchValueHandler, innerObservableImpl}
import scala.reflect.TypeTest

/** `SplitMatchOneMacros` turns this code
/** `SplitMatchOneMacros` turns this code:
*
* ```scala
* {{{
* sealed trait Foo
* final case class Bar(strOpt: Option[String]) extends Foo
* enum Baz extends Foo {
Expand All @@ -30,11 +30,11 @@ import scala.reflect.TypeTest
* case _: Int => ()
* } { (_, _) => div("Taz") }
* .toSignal
* ```
* }}}
*
* into this code:
*
* ```scala
* {{{
* val splitter = fooSignal
* .map { i =>
* i match {
Expand All @@ -45,7 +45,7 @@ import scala.reflect.TypeTest
* }
* }
* .splitOne(_._1) { ??? }
* ```
* }}}
*
* After macros expansion, compiler will warns above code "match may not be
* exhaustive" and "unreachable case" as expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import scala.annotation.compileTimeOnly
import com.raquo.airstream.split.MacrosUtilities.{CaseAny, HandlerAny, MatchTypeHandler}

/** `MatchTypeObservable` served as macro's data holder for macro expansion.
*
* For example:
*
* ```scala
* fooSignal.splitMatchOne
* .handleType[Baz] { (baz, bazSignal) => renderBazNode(baz, bazSignal) }
* ```
*
* will be expanded sematically into:
*
* ```scala
* MatchTypeObservable.build[*, *, *, Baz](fooSignal)()(???)({ case t: Baz => t })
* ```
*
* and then into:
*
* ```scala
* MatchSplitObservable.build(fooSignal)({ case baz: Baz => baz })(???)
* ```
*/
*
* For example:
*
* {{{
* fooSignal.splitMatchOne
* .handleType[Baz] { (baz, bazSignal) => renderBazNode(baz, bazSignal) }
* }}}
*
* will be expanded sematically into:
*
* {{{
* MatchTypeObservable.build[*, *, *, Baz](fooSignal)()(???)({ case t: Baz => t })
* }}}
*
* and then into:
*
* {{{
* MatchSplitObservable.build(fooSignal)({ case baz: Baz => baz })(???)
* }}}
*/

final case class SplitMatchOneTypeObservable[Self[+_] <: Observable[_], I, O, T] private (private val underlying: Unit) extends AnyVal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import scala.annotation.compileTimeOnly
import com.raquo.airstream.split.MacrosUtilities.{CaseAny, HandlerAny, MatchValueHandler}

/** `MatchSingletonObservable` served as macro's data holder for macro expansion.
*
* For example:
*
* ```scala
* fooSignal.splitMatchOne
* .splitValue(Tar)(tarSignal => renderTarNode(tarSignal))
* ```
*
* will be expanded sematically into:
*
* ```scala
* MatchTypeObservable.build[*, *, *, Baz](fooSignal)()(???)({ case Tar => Tar })
* ```
*
* and then into:
*
* ```scala
* MatchSplitObservable.build(fooSignal)({ case Tar => Tar })(???)
* ```
*/
*
* For example:
*
* {{{
* fooSignal.splitMatchOne
* .splitValue(Tar)(tarSignal => renderTarNode(tarSignal))
* }}}
*
* will be expanded sematically into:
*
* {{{
* MatchTypeObservable.build[*, *, *, Baz](fooSignal)()(???)({ case Tar => Tar })
* }}}
*
* and then into:
*
* {{{
* MatchSplitObservable.build(fooSignal)({ case Tar => Tar })(???)
* }}}
*/

final case class SplitMatchOneValueObservable[Self[+_] <: Observable[_], I, O, V] private (private val underlying: Unit) extends AnyVal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import scala.util.{Failure, Success, Try}

/** This implicit class provides debug* methods for observables, e.g.:
*
* stream.debugWithName("MyStream").debugSpyStarts().debugLogEvents()
* {{{
* stream.debugWithName("MyStream").debugSpyStarts().debugLogEvents()
* }}}
*
* The result of the chain is an observable that you should use in place
* of the original observable (`stream` in this case).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import scala.util.{Failure, Success, Try}

/** This implicit class provides Signal-specific debug* methods, e.g.:
*
* signal.debugLogInitialEval().debugLog()
* {{{
* signal.debugLogInitialEval().debugLog()
* }}}
*
* See [[DebuggableObservable]] and the docs for details.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/raquo/airstream/misc/DropStream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.raquo.airstream.core.{EventStream, Protected, Transaction}
*
* Note: only events are dropped, not errors.
*
* @param dropWhile nextEvent => shouldDrop
* @param dropWhile `nextEvent => shouldDrop`
* Function which determines whether this stream should drop the given event.
* Warning: MUST NOT THROW!
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import scala.util.{Failure, Success, Try}

// #TODO[API] Since this has an initial value, should this be a signal perhaps?

/** @param next (currentState => (nextState, nextIntervalMs)
/** @param next `(currentState => (nextState, nextIntervalMs)`
* Note: guarded against exceptions.
* If `next` throws, stream will emit that error
*/
Expand Down

0 comments on commit 83ee60e

Please sign in to comment.