@@ -162,7 +162,7 @@ class ReplDriver(settings: Array[String],
162162 /* complete = */ false // if true adds space when completing
163163 )
164164 }
165- val comps = completions (line.cursor, line.line, state)
165+ val comps = completionsWithSignatures (line.cursor, line.line, state)
166166 candidates.addAll(comps.map(_.label).distinct.map(makeCandidate).asJava)
167167 val lineWord = line.word()
168168 comps.filter(c => c.label == lineWord && c.symbols.nonEmpty) match
@@ -254,8 +254,23 @@ class ReplDriver(settings: Array[String],
254254 else
255255 label
256256
257+ @ deprecated(" Use completionsWithSignatures instead" , " 3.3.4" )
258+ protected final def completions (cursor : Int , expr : String , state0 : State ): List [Candidate ] =
259+ completionsWithSignatures(cursor, expr, state0).map: c =>
260+ new Candidate (
261+ /* value = */ c.label,
262+ /* displ = */ stripBackTicks(c.label), // displayed value
263+ /* group = */ null , // can be used to group completions together
264+ /* descr = */ null , // TODO use for documentation?
265+ /* suffix = */ null ,
266+ /* key = */ null ,
267+ /* complete = */ false // if true adds space when completing
268+ )
269+ end completions
270+
271+
257272 /** Extract possible completions at the index of `cursor` in `expr` */
258- protected final def completions (cursor : Int , expr : String , state0 : State ): List [Completion ] =
273+ protected final def completionsWithSignatures (cursor : Int , expr : String , state0 : State ): List [Completion ] =
259274 if expr.startsWith(" :" ) then
260275 ParseResult .commands.collect {
261276 case command if command._1.startsWith(expr) => Completion (command._1, " " , List ())
@@ -274,7 +289,7 @@ class ReplDriver(settings: Array[String],
274289 try Completion .completions(srcPos)._2 catch case NonFatal (_) => Nil
275290 }
276291 .getOrElse(Nil )
277- end completions
292+ end completionsWithSignatures
278293
279294 protected def interpret (res : ParseResult , quiet : Boolean = false )(using state : State ): State = {
280295 res match {
0 commit comments