use old-style "textEdit" for the sake of the external protocol (see also vscode-languageserver-node/issues/188);
authorwenzelm
Sat, 10 Jun 2017 22:48:35 +0200
changeset 66062 175772371cd0
parent 66061 880db47fed30
child 66063 a2e441805d6a
use old-style "textEdit" for the sake of the external protocol (see also vscode-languageserver-node/issues/188);
src/Tools/VSCode/src/protocol.scala
--- a/src/Tools/VSCode/src/protocol.scala	Sat Jun 10 21:48:02 2017 +0200
+++ b/src/Tools/VSCode/src/protocol.scala	Sat Jun 10 22:48:35 2017 +0200
@@ -331,7 +331,9 @@
       JSON.optional("detail" -> detail) ++
       JSON.optional("documentation" -> documentation) ++
       JSON.optional("insertText" -> insertText) ++
-      JSON.optional("range" -> range.map(Range(_)))
+      JSON.optional("range" -> range.map(Range(_))) ++
+      JSON.optional("textEdit" ->
+        range.map(r => Map("range" -> Range(r), "newText" -> insertText.getOrElse(label))))
   }
 
   object Completion extends RequestTextDocumentPosition("textDocument/completion")