lsp: removed change_document normalization because it causes desyncs;
authorThomas Lindae <thomas.lindae@in.tum.de>
Thu, 30 May 2024 02:43:16 +0200
changeset 81020 0efa8e784384
parent 81019 dd59daa3c37a
child 81021 89bfada3a16d
lsp: removed change_document normalization because it causes desyncs;
src/Tools/VSCode/src/language_server.scala
--- a/src/Tools/VSCode/src/language_server.scala	Mon Sep 30 20:30:59 2024 +0200
+++ b/src/Tools/VSCode/src/language_server.scala	Thu May 30 02:43:16 2024 +0200
@@ -166,18 +166,7 @@
     version: Long,
     changes: List[LSP.TextDocumentChange]
   ): Unit = {
-    val norm_changes = new mutable.ListBuffer[LSP.TextDocumentChange]
-    @tailrec def norm(chs: List[LSP.TextDocumentChange]): Unit = {
-      if (chs.nonEmpty) {
-        val (full_texts, rest1) = chs.span(_.range.isEmpty)
-        val (edits, rest2) = rest1.span(_.range.nonEmpty)
-        norm_changes ++= full_texts
-        norm_changes ++= edits.sortBy(_.range.get.start)(Line.Position.Ordering).reverse
-        norm(rest2)
-      }
-    }
-    norm(changes)
-    norm_changes.foreach(change =>
+    changes.foreach(change =>
       resources.change_model(session, editor, file, version, change.text, change.range))
 
     delay_input.invoke()