@@ -5,8 +5,6 @@ import core._
5
5
import Constants .Constant , Contexts .Context , Denotations ._ , Flags ._ , Names ._
6
6
import NameOps ._ , StdNames ._ , Decorators ._ , Scopes .Scope , Types ._ , Texts ._
7
7
import SymDenotations .NoDenotation , Symbols .{ Symbol , ClassSymbol , defn }
8
- import typer .Implicits .SearchResult
9
- import typer .ImportInfo
10
8
11
9
class UserFacingPrinter (_ctx : Context ) extends RefinedPrinter (_ctx) {
12
10
@@ -29,17 +27,8 @@ class UserFacingPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
29
27
30
28
def wellKnownPkg (pkgSym : Symbol ) = standardPkg(pkgSym) || wrappedName(pkgSym)
31
29
32
- override protected def keyString (sym : Symbol ): String = {
33
- val flags = sym.flagsUNSAFE
34
- if (flags is Package ) " "
35
- else if (sym.isPackageObject) " package object"
36
- else if (flags.is(Module ) && flags.is(Case )) " case object"
37
- else if (sym.isClass && flags.is(Case )) " case class"
38
- else if (flags.is(Lazy )) " lazy val"
39
- else if (flags is Module ) " object"
40
- else if (sym.isTerm && ! flags.is(Param ) && flags.is(Implicit )) " implicit val"
41
- else super .keyString(sym)
42
- }
30
+ override protected def keyString (sym : Symbol ): String =
31
+ if (sym.flagsUNSAFE is Package ) " " else super .keyString(sym)
43
32
44
33
override def nameString (name : Name ): String =
45
34
if (name.isReplAssignName) name.decode.toString.takeWhile(_ != '$' )
@@ -49,34 +38,24 @@ class UserFacingPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
49
38
if (sym.name.isReplAssignName) nameString(sym.name)
50
39
else keyString(sym) ~~ nameString(sym.name.stripModuleClassSuffix)
51
40
52
- override def dclText (sym : Symbol ): Text =
53
- toText(sym) ~ {
54
- if (sym.is(Method )) toText(sym.info)
55
- else if (sym.isClass) " "
56
- else if (sym.isType && sym.info.isInstanceOf [TypeAlias ]) toText(sym.info)
57
- else if (sym.isType) " "
58
- else {
59
- " :" ~~ toText(sym.info)
60
- }
61
- }
41
+ override def dclText (sym : Symbol ): Text = toText(sym) ~ {
42
+ if (sym.is(Method )) toText(sym.info)
43
+ else if (sym.isType && sym.info.isInstanceOf [TypeAlias ]) toText(sym.info)
44
+ else if (sym.isType || sym.isClass) " "
45
+ else " :" ~~ toText(sym.info)
46
+ }
62
47
63
48
override def toText (const : Constant ): Text = Str (const.value.toString)
64
49
65
50
override def toText (tp : Type ): Text = tp match {
66
- case tp : ConstantType => toText(tp.value)
67
51
case ExprType (result) => " :" ~~ toText(result)
52
+ case tp : ConstantType => toText(tp.value)
68
53
case tp : TypeRef => tp.info match {
69
54
case TypeAlias (alias) => toText(alias)
70
55
case _ => toText(tp.info)
71
56
}
72
- case tp : ParamRef => {
73
- val name = ParamRefNameString (tp.paramName)
74
- if (tp.isInstanceOf [TermParamRef ]) name ~ " .type"
75
- else name
76
- }
77
57
case tp : ClassInfo => {
78
- if (wellKnownPkg(tp.cls.owner))
79
- nameString(tp.cls.name)
58
+ if (wellKnownPkg(tp.cls.owner)) nameString(tp.cls.name)
80
59
else {
81
60
def printPkg (sym : ClassSymbol ): Text =
82
61
if (sym.owner == defn.RootClass || wrappedName(sym.owner))
0 commit comments