@@ -163,7 +163,7 @@ class ReplDriver(settings: Array[String],
163163 /* complete = */ false // if true adds space when completing
164164 )
165165 }
166- val comps = completions (line.cursor, line.line, state)
166+ val comps = completionsWithSignatures (line.cursor, line.line, state)
167167 candidates.addAll(comps.map(_.label).distinct.map(makeCandidate).asJava)
168168 val lineWord = line.word()
169169 comps.filter(c => c.label == lineWord && c.symbols.nonEmpty) match
@@ -255,8 +255,22 @@ class ReplDriver(settings: Array[String],
255255 else
256256 label
257257
258+ @ deprecated(" Use completionsWithSignatures instead" , " 3.4.2" )
259+ protected final def completions (cursor : Int , expr : String , state0 : State ): List [Candidate ] =
260+ completionsWithSignatures(cursor, expr, state0).map: c =>
261+ new Candidate (
262+ /* value = */ c.label,
263+ /* displ = */ stripBackTicks(c.label), // displayed value
264+ /* group = */ null , // can be used to group completions together
265+ /* descr = */ null , // TODO use for documentation?
266+ /* suffix = */ null ,
267+ /* key = */ null ,
268+ /* complete = */ false // if true adds space when completing
269+ )
270+ end completions
271+
258272 /** Extract possible completions at the index of `cursor` in `expr` */
259- 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 ] =
260274 if expr.startsWith(" :" ) then
261275 ParseResult .commands.collect {
262276 case command if command._1.startsWith(expr) => Completion (command._1, " " , List ())
@@ -275,7 +289,7 @@ class ReplDriver(settings: Array[String],
275289 try Completion .completions(srcPos)._2 catch case NonFatal (_) => Nil
276290 }
277291 .getOrElse(Nil )
278- end completions
292+ end completionsWithSignatures
279293
280294 protected def interpret (res : ParseResult , quiet : Boolean = false )(using state : State ): State = {
281295 res match {
0 commit comments