1
1
package dotty .tools .dotc .interactive
2
2
3
+ import java .nio .charset .Charset
4
+
3
5
import dotty .tools .dotc .ast .Trees ._
4
6
import dotty .tools .dotc .config .Printers .interactiv
5
7
import dotty .tools .dotc .core .Contexts .{Context , NoContext }
@@ -10,13 +12,13 @@ import dotty.tools.dotc.core.Flags._
10
12
import dotty .tools .dotc .core .Names .{Name , TermName }
11
13
import dotty .tools .dotc .core .NameKinds .SimpleNameKind
12
14
import dotty .tools .dotc .core .NameOps .NameDecorator
13
- import dotty .tools .dotc .core .Symbols .{defn , NoSymbol , Symbol }
15
+ import dotty .tools .dotc .core .Symbols .{NoSymbol , Symbol , defn }
14
16
import dotty .tools .dotc .core .Scopes
15
17
import dotty .tools .dotc .core .StdNames .{nme , tpnme }
16
18
import dotty .tools .dotc .core .TypeError
17
- import dotty .tools .dotc .core .Types .{NameFilter , NamedType , Type , NoType }
19
+ import dotty .tools .dotc .core .Types .{NameFilter , NamedType , NoType , Type }
18
20
import dotty .tools .dotc .printing .Texts ._
19
- import dotty .tools .dotc .util .{NoSourcePosition , SourcePosition }
21
+ import dotty .tools .dotc .util .{NameTransformer , NoSourcePosition , SourcePosition }
20
22
21
23
import scala .collection .mutable
22
24
@@ -150,8 +152,7 @@ object Completion {
150
152
nameToSymbols.map { case (name, symbols) =>
151
153
val typesFirst = symbols.sortWith((s1, s2) => s1.isType && ! s2.isType)
152
154
val desc = description(typesFirst)
153
- val strName = name.toString
154
- val label = if (strName == " $u2192" ) " →" else strName // TODO fix name.decode and use it
155
+ val label = NameTransformer .decodeIllegalChars(name.toString)
155
156
Completion (label, desc, typesFirst)
156
157
}
157
158
}
0 commit comments