martinring / clide2

A language agnostic collaborative cloud IDE
clide.flatmap.net
GNU Lesser General Public License v3.0
19 stars 2 forks source link

Support simple observation of text-range changes #26

Open martinring opened 10 years ago

martinring commented 10 years ago

It should be possible for assistants to easily register a listener on a specified text span and be informed if the span changes with regard to translation in the text. It should thus also be possible for the assistant to determine the current offset for a specific revision.

something like this should be possible

trait TextSpanUpdate {
  val file: OpenedFile // with current revision
  val offset: Int
  val content: String
}

def watchSpan(file: OpenedFile, start: Int, length: Int): Observable[TextSpanUpdate]

Where the updates only fire if content has changed not if the offset or the revision changes!

this also requires the reactive extensions framework for the observables.