lsp: added additional commit characters to immediate completions;
authorThomas Lindae <thomas.lindae@in.tum.de>
Fri, 19 Jul 2024 17:08:20 +0200
changeset 81083 aa77be3e8329
parent 81082 132080f5d15c
child 81084 96eb20106a34
lsp: added additional commit characters to immediate completions;
src/Tools/VSCode/src/vscode_rendering.scala
--- a/src/Tools/VSCode/src/vscode_rendering.scala	Thu Jul 18 23:02:49 2024 +0200
+++ b/src/Tools/VSCode/src/vscode_rendering.scala	Fri Jul 19 17:08:20 2024 +0200
@@ -109,6 +109,8 @@
             results match {
               case None => Nil
               case Some(result) =>
+                val commit_characters = (' ' to '~').toList.map(_.toString)
+
                 result.items.map(item => {
                   val kind = item.description match {
                     case _ :: "(keyword)" :: _ => LSP.CompletionItemKind.Keyword
@@ -121,7 +123,7 @@
                     detail = Some(item.description.mkString(" ")),
                     filter_text = Some(item.original),
                     commit_characters =
-                      if (result.unique && item.immediate) Some(List(" ")) else None,
+                      if (result.unique && item.immediate) Some(commit_characters) else None,
                     text = Some(item.replacement),
                     range = Some(doc.range(item.range)),
                   )