src/Tools/VSCode/src/server.scala
changeset 66674 30d5195299e2
parent 66389 fa473c07d86c
child 66675 6f4613dbfef6
     1.1 --- a/src/Tools/VSCode/src/server.scala	Mon Sep 18 10:28:22 2017 +0200
     1.2 +++ b/src/Tools/VSCode/src/server.scala	Mon Sep 18 10:32:09 2017 +0200
     1.3 @@ -153,7 +153,7 @@
     1.4      delay_output.invoke()
     1.5    }
     1.6  
     1.7 -  private def change_document(file: JFile, changes: List[Protocol.TextDocumentChange])
     1.8 +  private def change_document(file: JFile, version: Long, changes: List[Protocol.TextDocumentChange])
     1.9    {
    1.10      val norm_changes = new mutable.ListBuffer[Protocol.TextDocumentChange]
    1.11      @tailrec def norm(chs: List[Protocol.TextDocumentChange])
    1.12 @@ -168,7 +168,7 @@
    1.13      }
    1.14      norm(changes)
    1.15      norm_changes.foreach(change =>
    1.16 -      resources.change_model(session, editor, file, change.text, change.range))
    1.17 +      resources.change_model(session, editor, file, version, change.text, change.range))
    1.18  
    1.19      delay_input.invoke()
    1.20      delay_output.invoke()
    1.21 @@ -436,9 +436,10 @@
    1.22            case Protocol.Initialized(()) =>
    1.23            case Protocol.Shutdown(id) => shutdown(id)
    1.24            case Protocol.Exit(()) => exit()
    1.25 -          case Protocol.DidOpenTextDocument(file, _, _, text) =>
    1.26 -            change_document(file, List(Protocol.TextDocumentChange(None, text)))
    1.27 -          case Protocol.DidChangeTextDocument(file, _, changes) => change_document(file, changes)
    1.28 +          case Protocol.DidOpenTextDocument(file, _, version, text) =>
    1.29 +            change_document(file, version, List(Protocol.TextDocumentChange(None, text)))
    1.30 +          case Protocol.DidChangeTextDocument(file, version, changes) =>
    1.31 +            change_document(file, version, changes)
    1.32            case Protocol.DidCloseTextDocument(file) => close_document(file)
    1.33            case Protocol.Completion(id, node_pos) => completion(id, node_pos)
    1.34            case Protocol.Include_Word(()) => update_dictionary(true, false)