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

bleep.nosbt.util.Positions.scala Maven / Gradle / Ivy

There is a newer version: 0.0.12
Show newest version
package bleep.nosbt.util

/*
 * sbt
 * Copyright 2011 - 2018, Lightbend, Inc.
 * Copyright 2008 - 2010, Mark Harrah
 * Licensed under Apache License 2.0 (see LICENSE)
 */

sealed trait SourcePosition

sealed trait FilePosition extends SourcePosition {
  def path: String
  def startLine: Int
}

case object NoPosition extends SourcePosition

final case class LinePosition(path: String, startLine: Int) extends FilePosition

final case class LineRange(start: Int, end: Int) {
  def shift(n: Int) = new LineRange(start + n, end + n)
}

final case class RangePosition(path: String, range: LineRange) extends FilePosition {
  def startLine = range.start
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy