Skip to content

Commit 5b415ad

Browse files
committed
Fix docs indentation
1 parent d376905 commit 5b415ad

File tree

1 file changed

+82
-79
lines changed

1 file changed

+82
-79
lines changed

library/src/scala/tasty/Reflection.scala

Lines changed: 82 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
274274
type TypeBoundsTree = internal.TypeBoundsTree
275275

276276
/** Type tree representing wildcard type bounds written in the source.
277-
* The wildcard type `_` (for example in in `List[_]`) will be a type tree that
278-
* represents a type but has `TypeBound`a inside.
279-
*/
277+
* The wildcard type `_` (for example in in `List[_]`) will be a type tree that
278+
* represents a type but has `TypeBound`a inside.
279+
*/
280280
type WildcardTypeTree = internal.WildcardTypeTree
281281

282282
/** Branch of a pattern match or catch clause */
@@ -367,10 +367,10 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
367367

368368

369369
/** Import selectors:
370-
* * SimpleSelector: `.bar` in `import foo.bar`
371-
* * RenameSelector: `.{bar => baz}` in `import foo.{bar => baz}`
372-
* * OmitSelector: `.{bar => _}` in `import foo.{bar => _}`
373-
*/
370+
* * SimpleSelector: `.bar` in `import foo.bar`
371+
* * RenameSelector: `.{bar => baz}` in `import foo.{bar => baz}`
372+
* * OmitSelector: `.{bar => _}` in `import foo.{bar => _}`
373+
*/
374374
type ImportSelector = internal.ImportSelector
375375
type SimpleSelector = internal.SimpleSelector
376376
type RenameSelector = internal.RenameSelector
@@ -395,8 +395,8 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
395395
type Constant = internal.Constant
396396

397397
/** Symbol of a definition.
398-
* Then can be compared with == to know if the definition is the same.
399-
*/
398+
* Then can be compared with == to know if the definition is the same.
399+
*/
400400
type Symbol = internal.Symbol
401401

402402
/** FlagSet of a Symbol */
@@ -454,25 +454,27 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
454454
/** Context of the macro expansion */
455455
given rootContext: Context = internal.rootContext // TODO: Use given // TODO: Should this be moved to QuoteContext?
456456

457-
extension ContextOps on (self: Context) {
458-
/** Returns the owner of the context */
459-
def owner: Symbol = internal.Context_owner(self)
457+
object Context {
458+
extension ContextOps on (self: Context) {
459+
/** Returns the owner of the context */
460+
def owner: Symbol = internal.Context_owner(self)
460461

461-
/** Returns the source file being compiled. The path is relative to the current working directory. */
462-
def source: java.nio.file.Path = internal.Context_source(self)
462+
/** Returns the source file being compiled. The path is relative to the current working directory. */
463+
def source: java.nio.file.Path = internal.Context_source(self)
463464

464-
/** Get package symbol if package is either defined in current compilation run or present on classpath. */
465-
def requiredPackage(path: String): Symbol = internal.Context_requiredPackage(self)(path)
465+
/** Get package symbol if package is either defined in current compilation run or present on classpath. */
466+
def requiredPackage(path: String): Symbol = internal.Context_requiredPackage(self)(path)
466467

467-
/** Get class symbol if class is either defined in current compilation run or present on classpath. */
468-
def requiredClass(path: String): Symbol = internal.Context_requiredClass(self)(path)
468+
/** Get class symbol if class is either defined in current compilation run or present on classpath. */
469+
def requiredClass(path: String): Symbol = internal.Context_requiredClass(self)(path)
469470

470-
/** Get module symbol if module is either defined in current compilation run or present on classpath. */
471-
def requiredModule(path: String): Symbol = internal.Context_requiredModule(self)(path)
471+
/** Get module symbol if module is either defined in current compilation run or present on classpath. */
472+
def requiredModule(path: String): Symbol = internal.Context_requiredModule(self)(path)
472473

473-
/** Get method symbol if method is either defined in current compilation run or present on classpath. Throws if the method has an overload. */
474-
def requiredMethod(path: String): Symbol = internal.Context_requiredMethod(self)(path)
474+
/** Get method symbol if method is either defined in current compilation run or present on classpath. Throws if the method has an overload. */
475+
def requiredMethod(path: String): Symbol = internal.Context_requiredMethod(self)(path)
475476

477+
}
476478
}
477479

478480

@@ -675,19 +677,19 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
675677
object Ref {
676678

677679
/** Create a reference tree from a symbol
678-
*
679-
* If `sym` refers to a class member `foo` in class `C`,
680-
* returns a tree representing `C.this.foo`.
681-
*
682-
* If `sym` refers to a local definition `foo`, returns
683-
* a tree representing `foo`.
684-
*
685-
* @note In both cases, the constructed tree should only
686-
* be spliced into the places where such accesses make sense.
687-
* For example, it is incorrect to have `C.this.foo` outside
688-
* the class body of `C`, or have `foo` outside the lexical
689-
* scope for the definition of `foo`.
690-
*/
680+
*
681+
* If `sym` refers to a class member `foo` in class `C`,
682+
* returns a tree representing `C.this.foo`.
683+
*
684+
* If `sym` refers to a local definition `foo`, returns
685+
* a tree representing `foo`.
686+
*
687+
* @note In both cases, the constructed tree should only
688+
* be spliced into the places where such accesses make sense.
689+
* For example, it is incorrect to have `C.this.foo` outside
690+
* the class body of `C`, or have `foo` outside the lexical
691+
* scope for the definition of `foo`.
692+
*/
691693
def apply(sym: Symbol)(given ctx: Context): Ref =
692694
internal.Ref_apply(sym)
693695
}
@@ -1804,7 +1806,7 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
18041806

18051807
/**
18061808
* An accessor for `scala.internal.MatchCase[_,_]`, the representation of a `MatchType` case.
1807-
*/
1809+
*/
18081810
def MatchCaseType(given Context): Type = {
18091811
import scala.internal.MatchCase
18101812
Type(classOf[MatchCase[_,_]])
@@ -2028,15 +2030,16 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
20282030
* this symbol to the DefDef constructor.
20292031
*
20302032
* @note As a macro can only splice code into the point at which it is expanded, all generated symbols must be
2031-
* direct or indirect children of the reflection context's owner. */
2033+
* direct or indirect children of the reflection context's owner.
2034+
*/
20322035
def newMethod(parent: Symbol, name: String, tpe: Type)(given ctx: Context): Symbol =
20332036
newMethod(parent, name, tpe, Flags.EmptyFlags, noSymbol)
20342037

20352038
/** Works as the other newMethod, but with additional parameters.
20362039
*
20372040
* @param flags extra flags to with which the symbol should be constructed
20382041
* @param privateWithin the symbol within which this new method symbol should be private. May be noSymbol.
2039-
* */
2042+
*/
20402043
def newMethod(parent: Symbol, name: String, tpe: Type, flags: Flags, privateWithin: Symbol)(given ctx: Context): Symbol =
20412044
internal.Symbol_newMethod(parent, name, flags, tpe, privateWithin)
20422045

@@ -2194,12 +2197,12 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
21942197
extension signatureOps on (sig: Signature) {
21952198

21962199
/** The signatures of the method parameters.
2197-
*
2198-
* Each *type parameter section* is represented by a single Int corresponding
2199-
* to the number of type parameters in the section.
2200-
* Each *term parameter* is represented by a String corresponding to the fully qualified
2201-
* name of the parameter type.
2202-
*/
2200+
*
2201+
* Each *type parameter section* is represented by a single Int corresponding
2202+
* to the number of type parameters in the section.
2203+
* Each *term parameter* is represented by a String corresponding to the fully qualified
2204+
* name of the parameter type.
2205+
*/
22032206
def paramSigs: List[String | Int] = internal.Signature_paramSigs(sig)
22042207

22052208
/** The signature of the result type */
@@ -2217,8 +2220,8 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
22172220
object defn extends StandardSymbols with StandardTypes
22182221

22192222
/** Defines standard symbols (and types via its base trait).
2220-
* @group API
2221-
*/
2223+
* @group API
2224+
*/
22222225
trait StandardSymbols {
22232226

22242227
/** The module symbol of root package `_root_`. */
@@ -2315,8 +2318,8 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
23152318
def Array_update: Symbol = internal.Definitions_Array_update
23162319

23172320
/** A dummy class symbol that is used to indicate repeated parameters
2318-
* compiled by the Scala compiler.
2319-
*/
2321+
* compiled by the Scala compiler.
2322+
*/
23202323
def RepeatedParamClass: Symbol = internal.Definitions_RepeatedParamClass
23212324

23222325
/** The class symbol of class `scala.Option`. */
@@ -2332,23 +2335,23 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
23322335
def ProductClass: Symbol = internal.Definitions_ProductClass
23332336

23342337
/** Function-like object that maps arity to symbols for classes `scala.FunctionX`.
2335-
* - 0th element is `Function0`
2336-
* - 1st element is `Function1`
2337-
* - ...
2338-
* - Nth element is `FunctionN`
2339-
*/
2338+
* - 0th element is `Function0`
2339+
* - 1st element is `Function1`
2340+
* - ...
2341+
* - Nth element is `FunctionN`
2342+
*/
23402343
def FunctionClass(arity: Int, isImplicit: Boolean = false, isErased: Boolean = false): Symbol =
23412344
internal.Definitions_FunctionClass(arity, isImplicit, isErased)
23422345

23432346
/** Function-like object that maps arity to symbols for classes `scala.TupleX`.
2344-
* - 0th element is `NoSymbol`
2345-
* - 1st element is `NoSymbol`
2346-
* - 2st element is `Tuple2`
2347-
* - ...
2348-
* - 22nd element is `Tuple22`
2349-
* - 23nd element is `NoSymbol` // TODO update when we will have more tuples
2350-
* - ...
2351-
*/
2347+
* - 0th element is `NoSymbol`
2348+
* - 1st element is `NoSymbol`
2349+
* - 2st element is `Tuple2`
2350+
* - ...
2351+
* - 22nd element is `Tuple22`
2352+
* - 23nd element is `NoSymbol` // TODO update when we will have more tuples
2353+
* - ...
2354+
*/
23522355
def TupleClass(arity: Int): Symbol =
23532356
internal.Definitions_TupleClass(arity)
23542357

@@ -2357,28 +2360,28 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
23572360
internal.Definitions_isTupleClass(sym)
23582361

23592362
/** Contains Scala primitive value classes:
2360-
* - Byte
2361-
* - Short
2362-
* - Int
2363-
* - Long
2364-
* - Float
2365-
* - Double
2366-
* - Char
2367-
* - Boolean
2368-
* - Unit
2369-
*/
2363+
* - Byte
2364+
* - Short
2365+
* - Int
2366+
* - Long
2367+
* - Float
2368+
* - Double
2369+
* - Char
2370+
* - Boolean
2371+
* - Unit
2372+
*/
23702373
def ScalaPrimitiveValueClasses: List[Symbol] =
23712374
UnitClass :: BooleanClass :: ScalaNumericValueClasses
23722375

23732376
/** Contains Scala numeric value classes:
2374-
* - Byte
2375-
* - Short
2376-
* - Int
2377-
* - Long
2378-
* - Float
2379-
* - Double
2380-
* - Char
2381-
*/
2377+
* - Byte
2378+
* - Short
2379+
* - Int
2380+
* - Long
2381+
* - Float
2382+
* - Double
2383+
* - Char
2384+
*/
23822385
def ScalaNumericValueClasses: List[Symbol] =
23832386
ByteClass :: ShortClass :: IntClass :: LongClass :: FloatClass :: DoubleClass :: CharClass :: Nil
23842387

0 commit comments

Comments
 (0)