File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/dotty/tools/dotc/util Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,13 @@ object NameTransformer {
54
54
else name
55
55
}
56
56
57
+ def encodeString (name : String ): String = name.map{ch =>
58
+ lazy val repl = op2code(ch)
59
+ if (ch <= nops && repl != null )
60
+ repl
61
+ else ch
62
+ }.toString()
63
+
57
64
/** Replace operator symbols by corresponding expansion strings.
58
65
*
59
66
* @param name the string to encode
Original file line number Diff line number Diff line change @@ -29,8 +29,12 @@ class TabcompleteTests extends ReplTest {
29
29
comp.suggestions.sorted == List (" slice" , " sliding" ))
30
30
}
31
31
32
- @ Test def classModuleHiding : Unit =
33
- fromInitialState{ implicit s => assert(tabComplete(" scala.Predef" ).suggestions.isEmpty) }
32
+ @ Test def tabCompleteModule : Unit =
33
+ fromInitialState{ implicit s =>
34
+ val comp = tabComplete(" scala.Pred" ).suggestions
35
+ assertTrue(s """ "Expected single element "Predef" got: ${comp}""" ,
36
+ comp == List (" Predef" ))
37
+ }
34
38
35
39
@ Test def autoCompleteValAssign : Unit =
36
40
fromInitialState { implicit s => tabComplete(" val x = 5" ) }
You can’t perform that action at this time.
0 commit comments