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