@@ -9,9 +9,9 @@ import dotty.tools.dotc.core.Decorators._
99import dotty .tools .dotc .core .quoted .PickledQuotes
1010import dotty .tools .dotc .util .SourcePosition
1111
12- import scala .quoted
12+ import scala .{ quoted , tasty }
1313import scala .reflect .ClassTag
14- import scala .tasty .util .{Show , ShowExtractors }
14+ import scala .tasty .util .{Show , ShowExtractors , ShowSourceCode }
1515
1616object TastyImpl extends scala.tasty.Tasty {
1717
@@ -31,8 +31,7 @@ object TastyImpl extends scala.tasty.Tasty {
3131
3232 def showExtractors : Show [this .type ] = new ShowExtractors (this )
3333
34- // TODO
35- // def showSourceCode: Show[this.type] = ???
34+ def showSourceCode : Show [this .type ] = new ShowSourceCode (this )
3635
3736 // ===== Contexts =================================================
3837
@@ -127,10 +126,18 @@ object TastyImpl extends scala.tasty.Tasty {
127126
128127 type Definition = tpd.Tree
129128
129+ object Definition extends DefinitionExtractor {
130+ def unapply (x : Definition )(implicit ctx : Context ): Boolean =
131+ x.isInstanceOf [Trees .MemberDef [_]]
132+ }
133+
130134 def DefinitionDeco (x : Definition ): AbstractDefinition = new AbstractDefinition {
131135
132136 def owner (implicit ctx : Context ): Definition = FromSymbol .definition(x.symbol.owner)
133137
138+ def flags (implicit ctx : Contexts .Context ): FlagSet =
139+ new FlagSet (x.symbol.flags)
140+
134141 def mods (implicit ctx : Context ): List [Modifier ] = {
135142 val privateWithin = x.symbol.privateWithin
136143 val isProtected = x.symbol.is(core.Flags .Protected )
0 commit comments