@@ -9,9 +9,9 @@ import dotty.tools.dotc.core.Decorators._
9
9
import dotty .tools .dotc .core .quoted .PickledQuotes
10
10
import dotty .tools .dotc .util .SourcePosition
11
11
12
- import scala .quoted
12
+ import scala .{ quoted , tasty }
13
13
import scala .reflect .ClassTag
14
- import scala .tasty .util .{Show , ShowExtractors }
14
+ import scala .tasty .util .{Show , ShowExtractors , ShowSourceCode }
15
15
16
16
object TastyImpl extends scala.tasty.Tasty {
17
17
@@ -31,8 +31,7 @@ object TastyImpl extends scala.tasty.Tasty {
31
31
32
32
def showExtractors : Show [this .type ] = new ShowExtractors (this )
33
33
34
- // TODO
35
- // def showSourceCode: Show[this.type] = ???
34
+ def showSourceCode : Show [this .type ] = new ShowSourceCode (this )
36
35
37
36
// ===== Contexts =================================================
38
37
@@ -127,10 +126,18 @@ object TastyImpl extends scala.tasty.Tasty {
127
126
128
127
type Definition = tpd.Tree
129
128
129
+ object Definition extends DefinitionExtractor {
130
+ def unapply (x : Definition )(implicit ctx : Context ): Boolean =
131
+ x.isInstanceOf [Trees .MemberDef [_]]
132
+ }
133
+
130
134
def DefinitionDeco (x : Definition ): AbstractDefinition = new AbstractDefinition {
131
135
132
136
def owner (implicit ctx : Context ): Definition = FromSymbol .definition(x.symbol.owner)
133
137
138
+ def flags (implicit ctx : Contexts .Context ): FlagSet =
139
+ new FlagSet (x.symbol.flags)
140
+
134
141
def mods (implicit ctx : Context ): List [Modifier ] = {
135
142
val privateWithin = x.symbol.privateWithin
136
143
val isProtected = x.symbol.is(core.Flags .Protected )
0 commit comments