All Downloads are FREE. Search and download functionalities are using the official Maven repository.

almond.interpreter.Completion.scala Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
package almond.interpreter

import argonaut.JsonObject

/**
  * Completion result
  *
  * @param from: position from which one of the completion can be substituted
  * @param until: position up to which one the completion can be substituted (not including the character at position `until`)
  * @param completions: possible replacements between indices `from` until `to`
  */
final case class Completion(
  from: Int,
  until: Int,
  completions: Seq[String],
  metadata: JsonObject
)

object Completion {
  def apply(from: Int, until: Int, completions: Seq[String]): Completion =
    Completion(from, until, completions, JsonObject.empty)
  def empty(pos: Int): Completion =
    Completion(pos, pos, Nil, JsonObject.empty)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy