--- a/src/Tools/VSCode/src/pretty_text_panel.scala Sat Dec 07 21:42:59 2024 +0100
+++ b/src/Tools/VSCode/src/pretty_text_panel.scala Sat Dec 07 21:49:05 2024 +0100
@@ -77,12 +77,14 @@
val decorations =
tree.cumulate[Option[String]](Text.Range.full, None, Rendering.text_color_elements,
{ case (_, m) => Some(Some(m.info.name)) }
- ).flatMap(e => e.info match {
- case None => None
- case Some(name) =>
- Some((document.range(e._1), "text_" ++ Rendering.get_text_color(name).get.toString))
- })
- .groupMap(_._2)(e => LSP.Decoration_Options(e._1, List())).toList
+ ).flatMap(info =>
+ info.info match {
+ case Some(name) =>
+ val range = document.range(info.range)
+ Some((range, "text_" + Rendering.get_text_color(name).get.toString))
+ case None => None
+ }
+ ).groupMap(_._2)(e => LSP.Decoration_Options(e._1, Nil)).toList
channel.write(output_json(text, Some(LSP.Decoration(decorations))))
}