@@ -163,7 +163,7 @@ class ReplDriver(settings: Array[String],
163
163
/* complete = */ false // if true adds space when completing
164
164
)
165
165
}
166
- val comps = completions (line.cursor, line.line, state)
166
+ val comps = completionsWithSignatures (line.cursor, line.line, state)
167
167
candidates.addAll(comps.map(_.label).distinct.map(makeCandidate).asJava)
168
168
val lineWord = line.word()
169
169
comps.filter(c => c.label == lineWord && c.symbols.nonEmpty) match
@@ -255,8 +255,22 @@ class ReplDriver(settings: Array[String],
255
255
else
256
256
label
257
257
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
+
258
272
/** 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 ] =
260
274
if expr.startsWith(" :" ) then
261
275
ParseResult .commands.collect {
262
276
case command if command._1.startsWith(expr) => Completion (command._1, " " , List ())
@@ -275,7 +289,7 @@ class ReplDriver(settings: Array[String],
275
289
try Completion .completions(srcPos)._2 catch case NonFatal (_) => Nil
276
290
}
277
291
.getOrElse(Nil )
278
- end completions
292
+ end completionsWithSignatures
279
293
280
294
protected def interpret (res : ParseResult , quiet : Boolean = false )(using state : State ): State = {
281
295
res match {
0 commit comments