@@ -24,48 +24,58 @@ trait Printers
24
24
implicit class TreeShowDeco (tree : Tree ) {
25
25
/** Shows the tree as extractors */
26
26
def showExtractors (implicit ctx : Context ): String = new ExtractorsPrinter ().showTree(tree)
27
- /** Shows the tree as source code */
28
- def showCode (implicit ctx : Context ): String = new SourceCodePrinter ().showTree(tree)
27
+ /** Shows the tree as fully typed source code.
28
+ * Will print Ansi colors if ctx.printColors is enabled.
29
+ */
30
+ def show (implicit ctx : Context ): String = new SourceCodePrinter ().showTree(tree)
29
31
}
30
32
31
33
/** Adds `show` as an extension method of a `TypeOrBounds` */
32
34
implicit class TypeOrBoundsShowDeco (tpe : TypeOrBounds ) {
33
35
/** Shows the tree as extractors */
34
36
def showExtractors (implicit ctx : Context ): String = new ExtractorsPrinter ().showTypeOrBounds(tpe)
35
- /** Shows the tree as source code */
36
- def showCode (implicit ctx : Context ): String = new SourceCodePrinter ().showTypeOrBounds(tpe)
37
+ /** Shows the tree as fully typed source code.
38
+ * Will print Ansi colors if ctx.printColors is enabled.
39
+ */
40
+ def show (implicit ctx : Context ): String = new SourceCodePrinter ().showTypeOrBounds(tpe)
37
41
}
38
42
39
43
/** Adds `show` as an extension method of a `Pattern` */
40
44
implicit class PatternShowDeco (pattern : Pattern ) {
41
45
/** Shows the tree as extractors */
42
46
def showExtractors (implicit ctx : Context ): String = new ExtractorsPrinter ().showPattern(pattern)
43
- /** Shows the tree as source code */
44
- def showCode (implicit ctx : Context ): String = new SourceCodePrinter ().showPattern(pattern)
47
+ /** Shows the tree as fully typed source code.
48
+ * Will print Ansi colors if ctx.printColors is enabled.
49
+ */
50
+ def show (implicit ctx : Context ): String = new SourceCodePrinter ().showPattern(pattern)
45
51
}
46
52
47
53
/** Adds `show` as an extension method of a `Constant` */
48
54
implicit class ConstantShowDeco (const : Constant ) {
49
55
/** Shows the tree as extractors */
50
56
def showExtractors (implicit ctx : Context ): String = new ExtractorsPrinter ().showConstant(const)
51
- /** Shows the tree as source code */
52
- def showCode (implicit ctx : Context ): String = new SourceCodePrinter ().showConstant(const)
57
+ /** Shows the tree as fully typed source code.
58
+ * Will print Ansi colors if ctx.printColors is enabled.
59
+ */
60
+ def show (implicit ctx : Context ): String = new SourceCodePrinter ().showConstant(const)
53
61
}
54
62
55
63
/** Adds `show` as an extension method of a `Symbol` */
56
64
implicit class SymbolShowDeco (symbol : Symbol ) {
57
65
/** Shows the tree as extractors */
58
66
def showExtractors (implicit ctx : Context ): String = new ExtractorsPrinter ().showSymbol(symbol)
59
- /** Shows the tree as source code */
60
- def showCode (implicit ctx : Context ): String = new SourceCodePrinter ().showSymbol(symbol)
67
+ /** Shows the tree as fully typed source code */
68
+ def show (implicit ctx : Context ): String = new SourceCodePrinter ().showSymbol(symbol)
61
69
}
62
70
63
71
/** Adds `show` as an extension method of a `Flags` */
64
72
implicit class FlagsShowDeco (flags : Flags ) {
65
73
/** Shows the tree as extractors */
66
74
def showExtractors (implicit ctx : Context ): String = new ExtractorsPrinter ().showFlags(flags)
67
- /** Shows the tree as source code */
68
- def showCode (implicit ctx : Context ): String = new SourceCodePrinter ().showFlags(flags)
75
+ /** Shows the tree as fully typed source code.
76
+ * Will print Ansi colors if ctx.printColors is enabled.
77
+ */
78
+ def show (implicit ctx : Context ): String = new SourceCodePrinter ().showFlags(flags)
69
79
}
70
80
71
81
abstract class Printer {
0 commit comments