| author | wenzelm |
| Mon, 28 Jul 2025 20:13:46 +0200 | |
| changeset 82926 | f4bc5313c821 |
| parent 82903 | 51c57bbb27f7 |
| child 82932 | 1337812b6d10 |
| permissions | -rw-r--r-- |
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
1 |
/* Title: Pure/PIDE/rendering.scala |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
3 |
|
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
4 |
Isabelle-specific implementation of quasi-abstract rendering and |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
5 |
markup interpretation. |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
6 |
*/ |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
7 |
|
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
8 |
package isabelle |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
9 |
|
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
10 |
|
| 66158 | 11 |
import java.io.{File => JFile}
|
12 |
import java.nio.file.FileSystems |
|
13 |
||
| 72869 | 14 |
import scala.collection.immutable.SortedMap |
15 |
||
16 |
||
| 66158 | 17 |
|
| 75393 | 18 |
object Rendering {
|
| 65101 | 19 |
/* color */ |
20 |
||
| 75393 | 21 |
object Color extends Enumeration {
|
|
65104
66b19d05dcee
decorations for background and foreground colors;
wenzelm
parents:
65101
diff
changeset
|
22 |
// background |
|
68871
f5c76072db55
more explicit status for "canceled" command within theory node;
wenzelm
parents:
68822
diff
changeset
|
23 |
val unprocessed1, running1, canceled, bad, intensify, entity, active, active_result, |
| 67322 | 24 |
markdown_bullet1, markdown_bullet2, markdown_bullet3, markdown_bullet4 = Value |
| 71601 | 25 |
val background_colors: ValueSet = values |
|
65104
66b19d05dcee
decorations for background and foreground colors;
wenzelm
parents:
65101
diff
changeset
|
26 |
|
|
66b19d05dcee
decorations for background and foreground colors;
wenzelm
parents:
65101
diff
changeset
|
27 |
// foreground |
| 65637 | 28 |
val quoted, antiquoted = Value |
| 71601 | 29 |
val foreground_colors: ValueSet = values -- background_colors |
| 65121 | 30 |
|
| 65124 | 31 |
// message underline |
| 65637 | 32 |
val writeln, information, warning, legacy, error = Value |
| 71601 | 33 |
val message_underline_colors: ValueSet = values -- background_colors -- foreground_colors |
| 65124 | 34 |
|
35 |
// message background |
|
| 65637 | 36 |
val writeln_message, information_message, tracing_message, |
37 |
warning_message, legacy_message, error_message = Value |
|
| 71601 | 38 |
val message_background_colors: ValueSet = |
| 65143 | 39 |
values -- background_colors -- foreground_colors -- message_underline_colors |
| 65144 | 40 |
|
41 |
// text |
|
| 65637 | 42 |
val main, keyword1, keyword2, keyword3, quasi_keyword, improper, operator, |
43 |
tfree, tvar, free, skolem, bound, `var`, inner_numeral, inner_quoted, |
|
|
69965
da5e7278286b
more markup for various text kinds, notably for nested formal comments;
wenzelm
parents:
69916
diff
changeset
|
44 |
inner_cartouche, comment1, comment2, comment3, dynamic, class_parameter, |
|
da5e7278286b
more markup for various text kinds, notably for nested formal comments;
wenzelm
parents:
69916
diff
changeset
|
45 |
antiquote, raw_text, plain_text = Value |
| 71601 | 46 |
val text_colors: ValueSet = |
| 65144 | 47 |
values -- background_colors -- foreground_colors -- message_underline_colors -- |
48 |
message_background_colors |
|
| 65911 | 49 |
|
| 65913 | 50 |
// text overview |
| 65911 | 51 |
val unprocessed, running = Value |
| 65913 | 52 |
val text_overview_colors = Set(unprocessed, running, error, warning) |
| 65101 | 53 |
} |
54 |
||
55 |
||
| 65190 | 56 |
/* output messages */ |
| 64676 | 57 |
|
58 |
val state_pri = 1 |
|
59 |
val writeln_pri = 2 |
|
60 |
val information_pri = 3 |
|
61 |
val tracing_pri = 4 |
|
62 |
val warning_pri = 5 |
|
63 |
val legacy_pri = 6 |
|
64 |
val error_pri = 7 |
|
65 |
||
66 |
val message_pri = Map( |
|
67 |
Markup.STATE -> state_pri, |
|
68 |
Markup.STATE_MESSAGE -> state_pri, |
|
69 |
Markup.WRITELN -> writeln_pri, |
|
70 |
Markup.WRITELN_MESSAGE -> writeln_pri, |
|
71 |
Markup.INFORMATION -> information_pri, |
|
72 |
Markup.INFORMATION_MESSAGE -> information_pri, |
|
73 |
Markup.TRACING -> tracing_pri, |
|
74 |
Markup.TRACING_MESSAGE -> tracing_pri, |
|
75 |
Markup.WARNING -> warning_pri, |
|
76 |
Markup.WARNING_MESSAGE -> warning_pri, |
|
77 |
Markup.LEGACY -> legacy_pri, |
|
78 |
Markup.LEGACY_MESSAGE -> legacy_pri, |
|
79 |
Markup.ERROR -> error_pri, |
|
| 65133 | 80 |
Markup.ERROR_MESSAGE -> error_pri |
81 |
).withDefaultValue(0) |
|
| 64676 | 82 |
|
| 65121 | 83 |
val message_underline_color = Map( |
84 |
writeln_pri -> Color.writeln, |
|
85 |
information_pri -> Color.information, |
|
86 |
warning_pri -> Color.warning, |
|
87 |
legacy_pri -> Color.legacy, |
|
88 |
error_pri -> Color.error) |
|
89 |
||
| 65124 | 90 |
val message_background_color = Map( |
91 |
writeln_pri -> Color.writeln_message, |
|
92 |
information_pri -> Color.information_message, |
|
93 |
tracing_pri -> Color.tracing_message, |
|
94 |
warning_pri -> Color.warning_message, |
|
95 |
legacy_pri -> Color.legacy_message, |
|
96 |
error_pri -> Color.error_message) |
|
97 |
||
| 64676 | 98 |
|
| 65144 | 99 |
/* text color */ |
100 |
||
|
81558
b57996a0688c
clarified term positions and markup: syntax = true means this is via concrete syntax;
wenzelm
parents:
81555
diff
changeset
|
101 |
def get_text_color(markup: Markup): Option[Color.Value] = |
|
81564
56075edacb10
tuned: more robust wrt. changes the Markup space;
wenzelm
parents:
81561
diff
changeset
|
102 |
if (Markup.has_syntax(markup.properties)) None |
|
56075edacb10
tuned: more robust wrt. changes the Markup space;
wenzelm
parents:
81561
diff
changeset
|
103 |
else text_color.get(markup.name) |
| 81555 | 104 |
|
| 81561 | 105 |
def get_foreground_text_color(markup: Markup): Option[Color.Value] = |
106 |
foreground.get(markup.name) orElse get_text_color(markup) |
|
| 81559 | 107 |
|
|
81564
56075edacb10
tuned: more robust wrt. changes the Markup space;
wenzelm
parents:
81561
diff
changeset
|
108 |
val text_color = Map( |
| 65144 | 109 |
Markup.KEYWORD1 -> Color.keyword1, |
110 |
Markup.KEYWORD2 -> Color.keyword2, |
|
111 |
Markup.KEYWORD3 -> Color.keyword3, |
|
112 |
Markup.QUASI_KEYWORD -> Color.quasi_keyword, |
|
|
81564
56075edacb10
tuned: more robust wrt. changes the Markup space;
wenzelm
parents:
81561
diff
changeset
|
113 |
Markup.IMPROPER -> Color.improper, |
| 65144 | 114 |
Markup.OPERATOR -> Color.operator, |
| 65145 | 115 |
Markup.STRING -> Color.main, |
116 |
Markup.ALT_STRING -> Color.main, |
|
117 |
Markup.CARTOUCHE -> Color.main, |
|
| 65144 | 118 |
Markup.LITERAL -> Color.keyword1, |
| 65145 | 119 |
Markup.DELIMITER -> Color.main, |
| 65144 | 120 |
Markup.TFREE -> Color.tfree, |
121 |
Markup.TVAR -> Color.tvar, |
|
|
81564
56075edacb10
tuned: more robust wrt. changes the Markup space;
wenzelm
parents:
81561
diff
changeset
|
122 |
Markup.FREE -> Color.free, |
|
56075edacb10
tuned: more robust wrt. changes the Markup space;
wenzelm
parents:
81561
diff
changeset
|
123 |
Markup.SKOLEM -> Color.skolem, |
| 65144 | 124 |
Markup.BOUND -> Color.bound, |
| 65637 | 125 |
Markup.VAR -> Color.`var`, |
| 65144 | 126 |
Markup.INNER_STRING -> Color.inner_quoted, |
127 |
Markup.INNER_CARTOUCHE -> Color.inner_cartouche, |
|
128 |
Markup.DYNAMIC_FACT -> Color.dynamic, |
|
129 |
Markup.CLASS_PARAMETER -> Color.class_parameter, |
|
130 |
Markup.ANTIQUOTE -> Color.antiquote, |
|
|
69965
da5e7278286b
more markup for various text kinds, notably for nested formal comments;
wenzelm
parents:
69916
diff
changeset
|
131 |
Markup.RAW_TEXT -> Color.raw_text, |
|
da5e7278286b
more markup for various text kinds, notably for nested formal comments;
wenzelm
parents:
69916
diff
changeset
|
132 |
Markup.PLAIN_TEXT -> Color.plain_text, |
| 65144 | 133 |
Markup.ML_KEYWORD1 -> Color.keyword1, |
134 |
Markup.ML_KEYWORD2 -> Color.keyword2, |
|
135 |
Markup.ML_KEYWORD3 -> Color.keyword3, |
|
| 65145 | 136 |
Markup.ML_DELIMITER -> Color.main, |
| 65144 | 137 |
Markup.ML_NUMERAL -> Color.inner_numeral, |
138 |
Markup.ML_CHAR -> Color.inner_quoted, |
|
139 |
Markup.ML_STRING -> Color.inner_quoted, |
|
| 69320 | 140 |
Markup.ML_COMMENT -> Color.comment1, |
|
69970
b5a47478897a
clarified rendering, notably of \<^latex>CARTOUCHE in outer syntax;
wenzelm
parents:
69965
diff
changeset
|
141 |
Markup.COMMENT -> Color.comment1, |
| 69320 | 142 |
Markup.COMMENT1 -> Color.comment1, |
143 |
Markup.COMMENT2 -> Color.comment2, |
|
144 |
Markup.COMMENT3 -> Color.comment3) |
|
| 65144 | 145 |
|
| 81559 | 146 |
private val foreground = |
| 66074 | 147 |
Map( |
148 |
Markup.STRING -> Color.quoted, |
|
149 |
Markup.ALT_STRING -> Color.quoted, |
|
150 |
Markup.CARTOUCHE -> Color.quoted, |
|
151 |
Markup.ANTIQUOTED -> Color.antiquoted) |
|
152 |
||
| 65144 | 153 |
|
| 65149 | 154 |
/* tooltips */ |
| 65101 | 155 |
|
| 81651 | 156 |
def gui_name(name: String, kind: String = "", prefix: String = ""): String = |
157 |
GUI.Name(name, kind = Word.informal(kind), prefix = prefix, |
|
| 81655 | 158 |
style = GUI.Style_Symbol_Decoded).toString |
| 81651 | 159 |
|
| 81559 | 160 |
def get_tooltip_description(name: String): Option[String] = tooltip_description.get(name) |
161 |
||
162 |
private val tooltip_description = |
|
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
163 |
Map( |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
164 |
Markup.TOKEN_RANGE -> "inner syntax token", |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
165 |
Markup.FREE -> "free variable", |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
166 |
Markup.SKOLEM -> "skolem variable", |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
167 |
Markup.BOUND -> "bound variable", |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
168 |
Markup.VAR -> "schematic variable", |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
169 |
Markup.TFREE -> "free type variable", |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
170 |
Markup.TVAR -> "schematic type variable") |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
171 |
|
| 65149 | 172 |
|
| 72900 | 173 |
/* entity focus */ |
174 |
||
| 75393 | 175 |
object Focus {
|
| 72900 | 176 |
def apply(ids: Set[Long]): Focus = new Focus(ids) |
177 |
val empty: Focus = apply(Set.empty) |
|
| 72905 | 178 |
def make(args: List[Text.Info[Focus]]): Focus = |
| 73359 | 179 |
args.foldLeft(empty) { case (focus1, Text.Info(_, focus2)) => focus1 ++ focus2 }
|
|
72927
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
180 |
|
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
181 |
val full: Focus = |
| 75393 | 182 |
new Focus(Set.empty) {
|
|
72927
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
183 |
override def apply(id: Long): Boolean = true |
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
184 |
override def toString: String = "Focus.full" |
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
185 |
} |
| 72900 | 186 |
} |
187 |
||
| 75393 | 188 |
sealed class Focus private[Rendering](protected val rep: Set[Long]) {
|
| 72900 | 189 |
def defined: Boolean = rep.nonEmpty |
190 |
def apply(id: Long): Boolean = rep.contains(id) |
|
191 |
def + (id: Long): Focus = if (rep.contains(id)) this else new Focus(rep + id) |
|
192 |
def ++ (other: Focus): Focus = |
|
193 |
if (this eq other) this |
|
194 |
else if (rep.isEmpty) other |
|
| 73359 | 195 |
else other.rep.iterator.foldLeft(this)(_ + _) |
| 72900 | 196 |
override def toString: String = rep.mkString("Focus(", ",", ")")
|
197 |
} |
|
198 |
||
199 |
||
| 65149 | 200 |
/* markup elements */ |
201 |
||
| 81559 | 202 |
val position_elements: Markup.Elements = |
|
72692
22aeec526ffd
support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents:
71601
diff
changeset
|
203 |
Markup.Elements(Markup.BINDING, Markup.ENTITY, Markup.REPORT, Markup.POSITION) |
|
22aeec526ffd
support for PIDE markup in batch build (inactive due to pide_reports=false);
wenzelm
parents:
71601
diff
changeset
|
204 |
|
| 81559 | 205 |
val semantic_completion_elements: Markup.Elements = |
| 66053 | 206 |
Markup.Elements(Markup.COMPLETION, Markup.NO_COMPLETION) |
207 |
||
| 81559 | 208 |
val language_context_elements: Markup.Elements = |
| 74887 | 209 |
Markup.Elements(Markup.STRING, Markup.ALT_STRING, |
| 66053 | 210 |
Markup.CARTOUCHE, Markup.COMMENT, Markup.LANGUAGE, |
211 |
Markup.ML_STRING, Markup.ML_COMMENT) |
|
212 |
||
| 81559 | 213 |
val language_elements: Markup.Elements = Markup.Elements(Markup.LANGUAGE) |
| 66053 | 214 |
|
| 81559 | 215 |
val active_elements: Markup.Elements = |
| 69650 | 216 |
Markup.Elements(Markup.DIALOG, Markup.BROWSER, Markup.GRAPHVIEW, Markup.THEORY_EXPORTS, |
| 65149 | 217 |
Markup.SENDBACK, Markup.JEDIT_ACTION, Markup.SIMP_TRACE_PANEL) |
218 |
||
| 81559 | 219 |
val background_elements: Markup.Elements = |
| 68758 | 220 |
Document_Status.Command_Status.proper_elements + Markup.WRITELN_MESSAGE + |
| 65149 | 221 |
Markup.STATE_MESSAGE + Markup.INFORMATION_MESSAGE + |
222 |
Markup.TRACING_MESSAGE + Markup.WARNING_MESSAGE + |
|
223 |
Markup.LEGACY_MESSAGE + Markup.ERROR_MESSAGE + |
|
224 |
Markup.BAD + Markup.INTENSIFY + Markup.ENTITY + |
|
| 67322 | 225 |
Markup.Markdown_Bullet.name ++ active_elements |
| 65149 | 226 |
|
| 81559 | 227 |
val foreground_elements: Markup.Elements = Markup.Elements(foreground.keySet) |
| 66074 | 228 |
|
| 81559 | 229 |
val text_color_elements: Markup.Elements = |
|
81564
56075edacb10
tuned: more robust wrt. changes the Markup space;
wenzelm
parents:
81561
diff
changeset
|
230 |
Markup.Elements(text_color.keySet) |
| 65149 | 231 |
|
| 81559 | 232 |
val structure_elements: Markup.Elements = |
|
81300
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
233 |
Markup.Elements(Markup.NOTATION, Markup.EXPRESSION, Markup.LANGUAGE, Markup.ML_TYPING, |
|
81304
228f4b9d1d67
clarified rendering: entity acts as atomic notation / expression;
wenzelm
parents:
81303
diff
changeset
|
234 |
Markup.MARKDOWN_PARAGRAPH, Markup.MARKDOWN_ITEM, Markup.Markdown_List.name, Markup.ENTITY, |
|
81300
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
235 |
Markup.COMMAND_SPAN) |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
236 |
|
| 81559 | 237 |
val tooltip_elements: Markup.Elements = |
|
80911
8ad5e6df050b
block markup for specific notation, notably infix and binder;
wenzelm
parents:
80889
diff
changeset
|
238 |
Markup.Elements(Markup.LANGUAGE, Markup.NOTATION, Markup.EXPRESSION, Markup.TIMING, |
|
8ad5e6df050b
block markup for specific notation, notably infix and binder;
wenzelm
parents:
80889
diff
changeset
|
239 |
Markup.ENTITY, Markup.SORTING, Markup.TYPING, Markup.CLASS_PARAMETER, Markup.ML_TYPING, |
|
81303
cee03fbcec0d
more rendering for Markup.COMMAND_SPAN, following Rendering.structure_elements;
wenzelm
parents:
81300
diff
changeset
|
240 |
Markup.ML_BREAKPOINT, Markup.PATH, Markup.DOC, Markup.URL, Markup.COMMAND_SPAN, |
| 69648 | 241 |
Markup.MARKDOWN_PARAGRAPH, Markup.MARKDOWN_ITEM, Markup.Markdown_List.name) ++ |
| 81559 | 242 |
Markup.Elements(tooltip_description.keySet) |
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
243 |
|
| 81559 | 244 |
val tooltip_message_elements: Markup.Elements = |
|
65129
06a7c2d316cf
more general tooltips, with uniform info range handling;
wenzelm
parents:
65126
diff
changeset
|
245 |
Markup.Elements(Markup.WRITELN, Markup.INFORMATION, Markup.WARNING, Markup.LEGACY, Markup.ERROR, |
|
06a7c2d316cf
more general tooltips, with uniform info range handling;
wenzelm
parents:
65126
diff
changeset
|
246 |
Markup.BAD) |
|
06a7c2d316cf
more general tooltips, with uniform info range handling;
wenzelm
parents:
65126
diff
changeset
|
247 |
|
| 81559 | 248 |
val message_elements: Markup.Elements = Markup.Elements(message_pri.keySet) |
249 |
val warning_elements: Markup.Elements = Markup.Elements(Markup.WARNING, Markup.LEGACY) |
|
250 |
val error_elements: Markup.Elements = Markup.Elements(Markup.ERROR) |
|
| 71499 | 251 |
|
| 81559 | 252 |
val comment_elements: Markup.Elements = |
|
80949
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
253 |
Markup.Elements(Markup.ML_COMMENT, Markup.COMMENT, Markup.COMMENT1, Markup.COMMENT2, |
|
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
254 |
Markup.COMMENT3) |
|
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
255 |
|
| 81559 | 256 |
val entity_elements: Markup.Elements = Markup.Elements(Markup.ENTITY) |
| 67132 | 257 |
|
| 81559 | 258 |
val antiquoted_elements: Markup.Elements = Markup.Elements(Markup.ANTIQUOTED) |
| 67336 | 259 |
|
| 81559 | 260 |
val meta_data_elements: Markup.Elements = |
| 69900 | 261 |
Markup.Elements(Markup.META_TITLE, Markup.META_CREATOR, Markup.META_CONTRIBUTOR, |
|
69916
3235ecdcd884
more meta data from "dcterms" (superset of "dc");
wenzelm
parents:
69900
diff
changeset
|
262 |
Markup.META_DATE, Markup.META_DESCRIPTION, Markup.META_LICENSE) |
| 69900 | 263 |
|
| 81559 | 264 |
val document_tag_elements: Markup.Elements = |
| 74782 | 265 |
Markup.Elements(Markup.Document_Tag.name) |
|
70135
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
266 |
|
| 81559 | 267 |
val markdown_elements: Markup.Elements = |
| 67336 | 268 |
Markup.Elements(Markup.MARKDOWN_PARAGRAPH, Markup.MARKDOWN_ITEM, Markup.Markdown_List.name, |
269 |
Markup.Markdown_Bullet.name) |
|
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
270 |
} |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
271 |
|
| 72856 | 272 |
class Rendering( |
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
273 |
val snapshot: Document.Snapshot, |
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
274 |
val options: Options, |
| 75393 | 275 |
val session: Session |
276 |
) {
|
|
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
277 |
override def toString: String = "Rendering(" + snapshot.toString + ")"
|
|
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
278 |
|
| 72856 | 279 |
def get_text(range: Text.Range): Option[String] = None |
| 66114 | 280 |
|
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
281 |
|
| 66117 | 282 |
/* caret */ |
283 |
||
| 75393 | 284 |
def before_caret_range(caret: Text.Offset): Text.Range = {
|
| 66117 | 285 |
val former_caret = snapshot.revert(caret) |
286 |
snapshot.convert(Text.Range(former_caret - 1, former_caret)) |
|
287 |
} |
|
288 |
||
289 |
||
| 64877 | 290 |
/* completion */ |
291 |
||
|
66054
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
292 |
def semantic_completion(completed_range: Option[Text.Range], caret_range: Text.Range) |
| 64877 | 293 |
: Option[Text.Info[Completion.Semantic]] = |
294 |
if (snapshot.is_outdated) None |
|
295 |
else {
|
|
|
66054
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
296 |
snapshot.select(caret_range, Rendering.semantic_completion_elements, _ => |
| 64877 | 297 |
{
|
298 |
case Completion.Semantic.Info(info) => |
|
299 |
completed_range match {
|
|
300 |
case Some(range0) if range0.contains(info.range) && range0 != info.range => None |
|
301 |
case _ => Some(info) |
|
302 |
} |
|
303 |
case _ => None |
|
304 |
}).headOption.map(_.info) |
|
305 |
} |
|
306 |
||
|
66054
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
307 |
def semantic_completion_result( |
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
308 |
history: Completion.History, |
| 66055 | 309 |
unicode: Boolean, |
|
66054
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
310 |
completed_range: Option[Text.Range], |
| 75393 | 311 |
caret_range: Text.Range |
312 |
): (Boolean, Option[Completion.Result]) = {
|
|
|
66054
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
313 |
semantic_completion(completed_range, caret_range) match {
|
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
314 |
case Some(Text.Info(_, Completion.No_Completion)) => (true, None) |
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
315 |
case Some(Text.Info(range, names: Completion.Names)) => |
| 72856 | 316 |
get_text(range) match {
|
| 66055 | 317 |
case Some(original) => (false, names.complete(range, history, unicode, original)) |
|
66054
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
318 |
case None => (false, None) |
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
319 |
} |
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
320 |
case None => (false, None) |
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
321 |
} |
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
322 |
} |
|
fb0eea226a4d
more uniform syntax_completion + semantic_completion;
wenzelm
parents:
66053
diff
changeset
|
323 |
|
| 66053 | 324 |
def language_context(range: Text.Range): Option[Completion.Language_Context] = |
325 |
snapshot.select(range, Rendering.language_context_elements, _ => |
|
326 |
{
|
|
| 76965 | 327 |
case Text.Info(_, XML.Elem(Markup.Language(lang), _)) => |
328 |
if (lang.delimited) Some(Completion.Language_Context(lang)) else None |
|
| 66053 | 329 |
case Text.Info(_, elem) |
330 |
if elem.name == Markup.ML_STRING || elem.name == Markup.ML_COMMENT => |
|
331 |
Some(Completion.Language_Context.ML_inner) |
|
332 |
case Text.Info(_, _) => |
|
333 |
Some(Completion.Language_Context.inner) |
|
334 |
}).headOption.map(_.info) |
|
335 |
||
| 66158 | 336 |
|
337 |
/* file-system path completion */ |
|
338 |
||
|
72842
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
339 |
def language_path(range: Text.Range): Option[Text.Info[Boolean]] = |
| 66053 | 340 |
snapshot.select(range, Rendering.language_elements, _ => |
341 |
{
|
|
| 76965 | 342 |
case Text.Info(info_range, XML.Elem(Markup.Language(lang), _)) if lang.is_path => |
343 |
Some((lang.delimited, snapshot.convert(info_range))) |
|
| 66053 | 344 |
case _ => None |
|
72842
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
345 |
}).headOption.map({ case Text.Info(_, (delimited, range)) => Text.Info(range, delimited) })
|
| 66053 | 346 |
|
| 75393 | 347 |
def path_completion(caret: Text.Offset): Option[Completion.Result] = {
|
348 |
def complete(text: String): List[(String, List[String])] = {
|
|
| 66158 | 349 |
try {
|
350 |
val path = Path.explode(text) |
|
351 |
val (dir, base_name) = |
|
352 |
if (text == "" || text.endsWith("/")) (path, "")
|
|
| 69366 | 353 |
else (path.dir, path.file_name) |
| 66158 | 354 |
|
| 76858 | 355 |
val directory = new JFile(session.resources.append_path(snapshot.node_name.master_dir, dir)) |
| 66158 | 356 |
val files = directory.listFiles |
357 |
if (files == null) Nil |
|
358 |
else {
|
|
359 |
val ignore = |
|
| 66923 | 360 |
space_explode(':', options.string("completion_path_ignore")).
|
| 66158 | 361 |
map(s => FileSystems.getDefault.getPathMatcher("glob:" + s))
|
362 |
(for {
|
|
363 |
file <- files.iterator |
|
364 |
||
365 |
name = file.getName |
|
366 |
if name.startsWith(base_name) |
|
367 |
path_name = new JFile(name).toPath |
|
368 |
if !ignore.exists(matcher => matcher.matches(path_name)) |
|
369 |
||
370 |
text1 = (dir + Path.basic(name)).implode_short |
|
371 |
if text != text1 |
|
372 |
||
373 |
is_dir = new JFile(directory, name).isDirectory |
|
374 |
replacement = text1 + (if (is_dir) "/" else "") |
|
375 |
descr = List(text1, if (is_dir) "(directory)" else "(file)") |
|
376 |
} yield (replacement, descr)).take(options.int("completion_limit")).toList
|
|
377 |
} |
|
378 |
} |
|
379 |
catch { case ERROR(_) => Nil }
|
|
380 |
} |
|
381 |
||
382 |
def is_wrapped(s: String): Boolean = |
|
383 |
s.startsWith("\"") && s.endsWith("\"") ||
|
|
384 |
s.startsWith(Symbol.open_decoded) && s.endsWith(Symbol.close_decoded) |
|
385 |
||
386 |
for {
|
|
|
72842
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
387 |
Text.Info(r1, delimited) <- language_path(before_caret_range(caret)) |
| 72856 | 388 |
s1 <- get_text(r1) |
|
72842
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
389 |
(r2, s2) <- |
|
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
390 |
if (is_wrapped(s1)) {
|
|
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
391 |
Some((Text.Range(r1.start + 1, r1.stop - 1), s1.substring(1, s1.length - 1))) |
|
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
392 |
} |
|
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
393 |
else if (delimited) Some((r1, s1)) |
|
6aae62f55c2b
clarified markup: support more completion, e.g. within ROOTS;
wenzelm
parents:
72729
diff
changeset
|
394 |
else None |
| 66158 | 395 |
if Path.is_valid(s2) |
396 |
paths = complete(s2) |
|
397 |
if paths.nonEmpty |
|
398 |
items = paths.map(p => Completion.Item(r2, s2, "", p._2, p._1, 0, false)) |
|
399 |
} yield Completion.Result(r2, s2, false, items) |
|
400 |
} |
|
| 66053 | 401 |
|
| 64877 | 402 |
|
| 65139 | 403 |
/* spell checker */ |
404 |
||
|
76233
f3b23f4eaaac
clarified signature, to support external tools like "isabelle narration";
wenzelm
parents:
75958
diff
changeset
|
405 |
lazy val spell_checker_include: Markup.Elements = |
|
67395
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
406 |
Markup.Elements(space_explode(',', options.string("spell_checker_include")): _*)
|
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
407 |
|
|
76233
f3b23f4eaaac
clarified signature, to support external tools like "isabelle narration";
wenzelm
parents:
75958
diff
changeset
|
408 |
lazy val spell_checker_exclude: Markup.Elements = |
|
f3b23f4eaaac
clarified signature, to support external tools like "isabelle narration";
wenzelm
parents:
75958
diff
changeset
|
409 |
Markup.Elements(space_explode(',', options.string("spell_checker_exclude")): _*)
|
|
f3b23f4eaaac
clarified signature, to support external tools like "isabelle narration";
wenzelm
parents:
75958
diff
changeset
|
410 |
|
|
f3b23f4eaaac
clarified signature, to support external tools like "isabelle narration";
wenzelm
parents:
75958
diff
changeset
|
411 |
lazy val spell_checker_elements: Markup.Elements = |
|
f3b23f4eaaac
clarified signature, to support external tools like "isabelle narration";
wenzelm
parents:
75958
diff
changeset
|
412 |
spell_checker_include ++ spell_checker_exclude |
| 65139 | 413 |
|
| 75393 | 414 |
def spell_checker(range: Text.Range): List[Text.Info[Text.Range]] = {
|
|
67395
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
415 |
val result = |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
416 |
snapshot.select(range, spell_checker_elements, _ => |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
417 |
{
|
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
418 |
case info => |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
419 |
Some( |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
420 |
if (spell_checker_include(info.info.name)) |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
421 |
Some(snapshot.convert(info.range)) |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
422 |
else None) |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
423 |
}) |
| 78592 | 424 |
for (case Text.Info(range, Some(range1)) <- result) |
|
67395
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
425 |
yield Text.Info(range, range1) |
|
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
426 |
} |
| 65139 | 427 |
|
428 |
def spell_checker_point(range: Text.Range): Option[Text.Range] = |
|
|
67395
b39d596b77ce
more accurate spell-checking for nested quotations / antiquotations, notably in formal comments;
wenzelm
parents:
67336
diff
changeset
|
429 |
spell_checker(range).headOption.map(_.info) |
| 65139 | 430 |
|
431 |
||
| 65101 | 432 |
/* text background */ |
433 |
||
| 75393 | 434 |
def background( |
435 |
elements: Markup.Elements, |
|
436 |
range: Text.Range, |
|
437 |
focus: Rendering.Focus |
|
438 |
) : List[Text.Info[Rendering.Color.Value]] = {
|
|
| 65101 | 439 |
for {
|
440 |
Text.Info(r, result) <- |
|
441 |
snapshot.cumulate[(List[Markup], Option[Rendering.Color.Value])]( |
|
| 72906 | 442 |
range, (List(Markup.Empty), None), elements, |
| 65101 | 443 |
command_states => |
444 |
{
|
|
| 72925 | 445 |
case ((markups, color), Text.Info(_, XML.Elem(markup, _))) |
| 68758 | 446 |
if markups.nonEmpty && Document_Status.Command_Status.proper_elements(markup.name) => |
| 65101 | 447 |
Some((markup :: markups, color)) |
| 82796 | 448 |
case (_, Text.Info(_, XML.Elem(Markup.Bad(_), _))) => |
| 65101 | 449 |
Some((Nil, Some(Rendering.Color.bad))) |
450 |
case (_, Text.Info(_, XML.Elem(Markup(Markup.INTENSIFY, _), _))) => |
|
451 |
Some((Nil, Some(Rendering.Color.intensify))) |
|
| 72929 | 452 |
case (_, Text.Info(_, XML.Elem(Markup.Entity.Occ(i), _))) if focus(i) => |
| 72903 | 453 |
Some((Nil, Some(Rendering.Color.entity))) |
| 67322 | 454 |
case (_, Text.Info(_, XML.Elem(Markup.Markdown_Bullet(depth), _))) => |
| 65101 | 455 |
val color = |
| 65150 | 456 |
depth % 4 match {
|
| 67322 | 457 |
case 1 => Rendering.Color.markdown_bullet1 |
458 |
case 2 => Rendering.Color.markdown_bullet2 |
|
459 |
case 3 => Rendering.Color.markdown_bullet3 |
|
460 |
case _ => Rendering.Color.markdown_bullet4 |
|
| 65101 | 461 |
} |
462 |
Some((Nil, Some(color))) |
|
| 72907 | 463 |
case (_, Text.Info(_, Protocol.Dialog(_, serial, result))) => |
| 65101 | 464 |
command_states.collectFirst( |
465 |
{ case st if st.results.defined(serial) => st.results.get(serial).get }) match
|
|
466 |
{
|
|
467 |
case Some(Protocol.Dialog_Result(res)) if res == result => |
|
468 |
Some((Nil, Some(Rendering.Color.active_result))) |
|
469 |
case _ => |
|
470 |
Some((Nil, Some(Rendering.Color.active))) |
|
471 |
} |
|
472 |
case (_, Text.Info(_, elem)) => |
|
473 |
if (Rendering.active_elements(elem.name)) |
|
474 |
Some((Nil, Some(Rendering.Color.active))) |
|
475 |
else None |
|
476 |
}) |
|
477 |
color <- |
|
| 72925 | 478 |
result match {
|
| 65101 | 479 |
case (markups, opt_color) if markups.nonEmpty => |
| 68758 | 480 |
val status = Document_Status.Command_Status.make(markups.iterator) |
| 65101 | 481 |
if (status.is_unprocessed) Some(Rendering.Color.unprocessed1) |
482 |
else if (status.is_running) Some(Rendering.Color.running1) |
|
|
68871
f5c76072db55
more explicit status for "canceled" command within theory node;
wenzelm
parents:
68822
diff
changeset
|
483 |
else if (status.is_canceled) Some(Rendering.Color.canceled) |
| 65101 | 484 |
else opt_color |
485 |
case (_, opt_color) => opt_color |
|
| 72925 | 486 |
} |
| 65101 | 487 |
} yield Text.Info(r, color) |
488 |
} |
|
489 |
||
490 |
||
491 |
/* text foreground */ |
|
492 |
||
493 |
def foreground(range: Text.Range): List[Text.Info[Rendering.Color.Value]] = |
|
494 |
snapshot.select(range, Rendering.foreground_elements, _ => |
|
495 |
{
|
|
| 66074 | 496 |
case info => Some(Rendering.foreground(info.info.name)) |
| 65101 | 497 |
}) |
498 |
||
499 |
||
| 72904 | 500 |
/* entity focus */ |
| 64767 | 501 |
|
| 72904 | 502 |
def entity_focus_defs(range: Text.Range): Rendering.Focus = |
| 72905 | 503 |
Rendering.Focus.make( |
504 |
snapshot.cumulate(range, Rendering.Focus.empty, Rendering.entity_elements, _ => |
|
| 72904 | 505 |
{
|
506 |
case (focus, Text.Info(_, XML.Elem(Markup.Entity.Def(i), _))) => Some(focus + i) |
|
507 |
case _ => None |
|
| 72905 | 508 |
})) |
| 72904 | 509 |
|
|
72927
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
510 |
def entity_focus(range: Text.Range, defs_focus: Rendering.Focus): Rendering.Focus = |
| 72905 | 511 |
Rendering.Focus.make( |
512 |
snapshot.cumulate(range, Rendering.Focus.empty, Rendering.entity_elements, _ => |
|
| 72904 | 513 |
{
|
514 |
case (focus, Text.Info(_, XML.Elem(Markup.Entity.Ref(i), _))) |
|
|
72927
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
515 |
if defs_focus(i) => Some(focus + i) |
| 72904 | 516 |
case _ => None |
| 72905 | 517 |
})) |
| 72904 | 518 |
|
519 |
||
520 |
/* caret focus */ |
|
| 64767 | 521 |
|
| 75393 | 522 |
def caret_focus(caret_range: Text.Range, defs_range: Text.Range): Rendering.Focus = {
|
| 72904 | 523 |
val focus = entity_focus_defs(caret_range) |
524 |
if (focus.defined) focus |
|
|
72927
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
525 |
else if (defs_range == Text.Range.offside) Rendering.Focus.empty |
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
526 |
else {
|
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
527 |
val defs_focus = |
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
528 |
if (defs_range == Text.Range.full) Rendering.Focus.full |
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
529 |
else entity_focus_defs(defs_range) |
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
530 |
entity_focus(caret_range, defs_focus) |
|
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
531 |
} |
| 64767 | 532 |
} |
533 |
||
| 75393 | 534 |
def caret_focus_ranges(caret_range: Text.Range, defs_range: Text.Range): List[Text.Range] = {
|
|
72927
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
535 |
val focus = caret_focus(caret_range, defs_range) |
| 72926 | 536 |
if (focus.defined) {
|
|
72927
69f768aff611
clarified caret focus modifier, depending on option "jedit_focus_modifier";
wenzelm
parents:
72926
diff
changeset
|
537 |
snapshot.cumulate[Boolean](defs_range, false, Rendering.entity_elements, _ => |
| 72904 | 538 |
{
|
| 72929 | 539 |
case (_, Text.Info(_, XML.Elem(Markup.Entity.Occ(i), _))) if focus(i) => Some(true) |
| 72904 | 540 |
case _ => None |
541 |
}).flatMap(info => if (info.info) Some(info.range) else None) |
|
| 64767 | 542 |
} |
543 |
else Nil |
|
544 |
} |
|
| 65121 | 545 |
|
546 |
||
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
547 |
/* messages */ |
| 65121 | 548 |
|
| 75393 | 549 |
def message_underline_color( |
550 |
elements: Markup.Elements, |
|
551 |
range: Text.Range |
|
552 |
) : List[Text.Info[Rendering.Color.Value]] = {
|
|
| 65121 | 553 |
val results = |
554 |
snapshot.cumulate[Int](range, 0, elements, _ => |
|
555 |
{
|
|
556 |
case (pri, Text.Info(_, elem)) => Some(pri max Rendering.message_pri(elem.name)) |
|
557 |
}) |
|
558 |
for {
|
|
559 |
Text.Info(r, pri) <- results |
|
560 |
color <- Rendering.message_underline_color.get(pri) |
|
561 |
} yield Text.Info(r, color) |
|
562 |
} |
|
| 65149 | 563 |
|
| 82903 | 564 |
def text_messages(range: Text.Range = Text.Range.full): List[Text.Info[XML.Elem]] = {
|
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
565 |
val results = |
| 72872 | 566 |
snapshot.cumulate[Vector[Command.Results.Entry]]( |
567 |
range, Vector.empty, Rendering.message_elements, command_states => |
|
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
568 |
{
|
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
569 |
case (res, Text.Info(_, elem)) => |
| 72872 | 570 |
Command.State.get_result_proper(command_states, elem.markup.properties) |
571 |
.map(res :+ _) |
|
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
572 |
}) |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
573 |
|
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
574 |
var seen_serials = Set.empty[Long] |
| 75393 | 575 |
def seen(i: Long): Boolean = {
|
| 72872 | 576 |
val b = seen_serials(i) |
577 |
seen_serials += i |
|
578 |
b |
|
579 |
} |
|
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
580 |
for {
|
| 72872 | 581 |
Text.Info(range, entries) <- results |
582 |
(i, elem) <- entries if !seen(i) |
|
| 72869 | 583 |
} yield Text.Info(range, elem) |
|
72858
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
584 |
} |
|
cb0c407fbc6e
added "isabelle log": print messages from build database;
wenzelm
parents:
72856
diff
changeset
|
585 |
|
| 65149 | 586 |
|
|
81300
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
587 |
/* markup structure */ |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
588 |
|
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
589 |
def markup_structure( |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
590 |
elements: Markup.Elements, |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
591 |
ranges: List[Text.Range], |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
592 |
filter: Text.Markup => Boolean = _ => true |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
593 |
): List[Text.Markup] = {
|
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
594 |
def cumulate(range: Text.Range): List[Text.Info[Option[Text.Markup]]] = |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
595 |
snapshot.cumulate[Option[Text.Markup]](range, None, elements, _ => |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
596 |
{
|
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
597 |
case (old, markup) => |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
598 |
Some(if (old.isEmpty || filter(markup)) Some(markup) else old) |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
599 |
}) |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
600 |
|
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
601 |
Library.distinct( |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
602 |
for (range <- ranges; case Text.Info(_, Some(m)) <- cumulate(range)) |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
603 |
yield m) |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
604 |
} |
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
605 |
|
|
42ff2b915b1d
support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents:
81205
diff
changeset
|
606 |
|
| 65149 | 607 |
/* tooltips */ |
608 |
||
| 69899 | 609 |
def timing_threshold: Double = 0.0 |
| 65149 | 610 |
|
611 |
private sealed case class Tooltip_Info( |
|
612 |
range: Text.Range, |
|
613 |
timing: Timing = Timing.zero, |
|
| 81395 | 614 |
messages: List[(Long, XML.Elem)] = Nil, |
615 |
rev_infos: List[(Boolean, Int, XML.Elem)] = Nil |
|
| 75393 | 616 |
) {
|
| 81203 | 617 |
def add_timing(t: Timing): Tooltip_Info = copy(timing = timing + t) |
| 81395 | 618 |
def add_message(r0: Text.Range, serial: Long, msg: XML.Elem): Tooltip_Info = {
|
| 65149 | 619 |
val r = snapshot.convert(r0) |
| 81395 | 620 |
if (range == r) copy(messages = (serial -> msg) :: messages) |
621 |
else copy(range = r, messages = List(serial -> msg)) |
|
| 65149 | 622 |
} |
| 81395 | 623 |
def add_info(r0: Text.Range, info: XML.Elem, |
624 |
important: Boolean = true, |
|
625 |
ord: Int = 0 |
|
626 |
): Tooltip_Info = {
|
|
| 65149 | 627 |
val r = snapshot.convert(r0) |
| 81395 | 628 |
val entry = (important, ord, info) |
|
81205
a22af970a5f9
clarified order of tooltips: make it less dependent on report order from ML (which differs for input vs. output);
wenzelm
parents:
81204
diff
changeset
|
629 |
if (range == r) copy(rev_infos = entry :: rev_infos) |
|
a22af970a5f9
clarified order of tooltips: make it less dependent on report order from ML (which differs for input vs. output);
wenzelm
parents:
81204
diff
changeset
|
630 |
else copy (range = r, rev_infos = List(entry)) |
| 65149 | 631 |
} |
| 81395 | 632 |
def add_info_text(r0: Text.Range, text: String, ord: Int = 0): Tooltip_Info = |
633 |
add_info(r0, Pretty.string(text), ord = ord) |
|
|
67933
604da273e18d
more robust timing info: do not rely on order of markup;
wenzelm
parents:
67824
diff
changeset
|
634 |
|
| 81395 | 635 |
def timing_info(elem: XML.Elem): Option[XML.Elem] = |
636 |
if (elem.markup.name == Markup.TIMING) {
|
|
637 |
if (timing.elapsed.seconds >= timing_threshold) {
|
|
638 |
Some(Pretty.string(timing.message)) |
|
639 |
} |
|
640 |
else None |
|
|
67933
604da273e18d
more robust timing info: do not rely on order of markup;
wenzelm
parents:
67824
diff
changeset
|
641 |
} |
| 81395 | 642 |
else Some(elem) |
643 |
def infos(important: Boolean = true): List[XML.Elem] = |
|
|
67933
604da273e18d
more robust timing info: do not rely on order of markup;
wenzelm
parents:
67824
diff
changeset
|
644 |
for {
|
| 81395 | 645 |
(is_important, _, elem) <- rev_infos.reverse.sortBy(_._2) if is_important == important |
646 |
elem1 <- timing_info(elem) |
|
647 |
} yield elem1 |
|
| 65149 | 648 |
} |
649 |
||
| 65488 | 650 |
def perhaps_append_file(node_name: Document.Node.Name, name: String): String = |
| 76858 | 651 |
if (Path.is_valid(name)) session.resources.append_path(node_name.master_dir, Path.explode(name)) |
| 76663 | 652 |
else name |
| 65487 | 653 |
|
| 81395 | 654 |
def tooltips(elements: Markup.Elements, range: Text.Range): Option[Text.Info[List[XML.Elem]]] = {
|
| 65149 | 655 |
val results = |
|
67824
661cd25304ae
more compact markup tree: output messages are already stored in command results (e.g. relevant for XML data representation);
wenzelm
parents:
67395
diff
changeset
|
656 |
snapshot.cumulate[Tooltip_Info](range, Tooltip_Info(range), elements, command_states => |
| 65149 | 657 |
{
|
| 81203 | 658 |
case (info, Text.Info(_, XML.Elem(Markup.Timing(t), _))) => Some(info.add_timing(t)) |
| 65149 | 659 |
|
| 82796 | 660 |
case (info, Text.Info(r0, msg @ XML.Elem(Markup.Bad(i), body))) |
| 81203 | 661 |
if body.nonEmpty => Some(info.add_message(r0, i, msg)) |
|
67824
661cd25304ae
more compact markup tree: output messages are already stored in command results (e.g. relevant for XML data representation);
wenzelm
parents:
67395
diff
changeset
|
662 |
|
|
661cd25304ae
more compact markup tree: output messages are already stored in command results (e.g. relevant for XML data representation);
wenzelm
parents:
67395
diff
changeset
|
663 |
case (info, Text.Info(r0, XML.Elem(Markup(name, props), _))) |
|
661cd25304ae
more compact markup tree: output messages are already stored in command results (e.g. relevant for XML data representation);
wenzelm
parents:
67395
diff
changeset
|
664 |
if Rendering.tooltip_message_elements(name) => |
| 81395 | 665 |
for ((i, msg) <- Command.State.get_result_proper(command_states, props)) |
666 |
yield info.add_message(r0, i, msg) |
|
| 65149 | 667 |
|
668 |
case (info, Text.Info(r0, XML.Elem(Markup.Entity(kind, name), _))) |
|
669 |
if kind != "" && kind != Markup.ML_DEF => |
|
| 81651 | 670 |
val txt = Rendering.gui_name(name, kind = kind) |
671 |
val info1 = info.add_info_text(r0, txt, ord = 2) |
|
| 81204 | 672 |
Some(if (kind == Markup.COMMAND) info1.add_info(r0, XML.elem(Markup.TIMING)) else info1) |
| 65149 | 673 |
|
674 |
case (info, Text.Info(r0, XML.Elem(Markup.Path(name), _))) => |
|
| 65488 | 675 |
val file = perhaps_append_file(snapshot.node_name, name) |
| 81397 | 676 |
val info1 = |
677 |
if (name == file) info |
|
| 81651 | 678 |
else info.add_info_text(r0, Rendering.gui_name(name, kind = "path")) |
679 |
Some(info1.add_info_text(r0, Rendering.gui_name(file, kind = "file"))) |
|
| 65149 | 680 |
|
681 |
case (info, Text.Info(r0, XML.Elem(Markup.Doc(name), _))) => |
|
| 81651 | 682 |
Some(info.add_info_text(r0, Rendering.gui_name(name, kind = "doc"))) |
| 65149 | 683 |
|
684 |
case (info, Text.Info(r0, XML.Elem(Markup.Url(name), _))) => |
|
| 81651 | 685 |
Some(info.add_info_text(r0, Rendering.gui_name(name, kind = "URL"))) |
| 65149 | 686 |
|
|
81303
cee03fbcec0d
more rendering for Markup.COMMAND_SPAN, following Rendering.structure_elements;
wenzelm
parents:
81300
diff
changeset
|
687 |
case (info, Text.Info(r0, XML.Elem(Markup.Command_Span(span), _))) => |
| 81651 | 688 |
Some(info.add_info_text(r0, Rendering.gui_name(span.name, kind = Markup.COMMAND_SPAN))) |
|
81303
cee03fbcec0d
more rendering for Markup.COMMAND_SPAN, following Rendering.structure_elements;
wenzelm
parents:
81300
diff
changeset
|
689 |
|
| 65149 | 690 |
case (info, Text.Info(r0, XML.Elem(Markup(name, _), body))) |
691 |
if name == Markup.SORTING || name == Markup.TYPING => |
|
|
81205
a22af970a5f9
clarified order of tooltips: make it less dependent on report order from ML (which differs for input vs. output);
wenzelm
parents:
81204
diff
changeset
|
692 |
Some(info.add_info(r0, Pretty.block(XML.Text("::") :: Pretty.brk(1) :: body), ord = 3))
|
| 65149 | 693 |
|
694 |
case (info, Text.Info(r0, XML.Elem(Markup(Markup.CLASS_PARAMETER, _), body))) => |
|
| 81204 | 695 |
Some(info.add_info(r0, Pretty.block(body, indent = 0))) |
| 65149 | 696 |
|
697 |
case (info, Text.Info(r0, XML.Elem(Markup(Markup.ML_TYPING, _), body))) => |
|
| 81204 | 698 |
Some(info.add_info(r0, Pretty.block(XML.Text("ML:") :: Pretty.brk(1) :: body),
|
699 |
important = false)) |
|
| 65149 | 700 |
|
701 |
case (info, Text.Info(r0, Protocol.ML_Breakpoint(breakpoint))) => |
|
| 81396 | 702 |
val text = |
703 |
if (session.debugger.breakpoint_state(breakpoint)) "breakpoint (enabled)" |
|
704 |
else "breakpoint (disabled)" |
|
705 |
Some(info.add_info_text(r0, text)) |
|
|
81303
cee03fbcec0d
more rendering for Markup.COMMAND_SPAN, following Rendering.structure_elements;
wenzelm
parents:
81300
diff
changeset
|
706 |
|
| 76965 | 707 |
case (info, Text.Info(r0, XML.Elem(Markup.Language(lang), _))) => |
| 81395 | 708 |
Some(info.add_info_text(r0, "language: " + lang.description)) |
| 65149 | 709 |
|
|
80911
8ad5e6df050b
block markup for specific notation, notably infix and binder;
wenzelm
parents:
80889
diff
changeset
|
710 |
case (info, Text.Info(r0, XML.Elem(Markup.Notation(kind, name), _))) => |
| 81651 | 711 |
val description = Rendering.gui_name(name, kind = kind, prefix = Markup.NOTATION) |
712 |
Some(info.add_info_text(r0, description, ord = 1)) |
|
|
80911
8ad5e6df050b
block markup for specific notation, notably infix and binder;
wenzelm
parents:
80889
diff
changeset
|
713 |
|
|
81630
5b87f8dacd8e
more uniform Markup.notation vs. Markup.expression;
wenzelm
parents:
81564
diff
changeset
|
714 |
case (info, Text.Info(r0, XML.Elem(Markup.Expression(kind, name), _))) => |
| 81651 | 715 |
val description = Rendering.gui_name(name, kind = kind, prefix = Markup.EXPRESSION) |
716 |
Some(info.add_info_text(r0, description, ord = 1)) |
|
| 65149 | 717 |
|
718 |
case (info, Text.Info(r0, XML.Elem(Markup(Markup.MARKDOWN_PARAGRAPH, _), _))) => |
|
| 81395 | 719 |
Some(info.add_info_text(r0, "Markdown: paragraph")) |
|
67323
d02208cefbdb
PIDE markup for Markdown items (which may consist of multiple paragraphs or lists);
wenzelm
parents:
67322
diff
changeset
|
720 |
case (info, Text.Info(r0, XML.Elem(Markup(Markup.MARKDOWN_ITEM, _), _))) => |
| 81395 | 721 |
Some(info.add_info_text(r0, "Markdown: item")) |
| 65149 | 722 |
case (info, Text.Info(r0, XML.Elem(Markup.Markdown_List(kind), _))) => |
| 81395 | 723 |
Some(info.add_info_text(r0, "Markdown: " + kind)) |
| 65149 | 724 |
|
725 |
case (info, Text.Info(r0, XML.Elem(Markup(name, _), _))) => |
|
| 81559 | 726 |
Rendering.get_tooltip_description(name).map(desc => info.add_info_text(r0, desc)) |
| 65149 | 727 |
}).map(_.info) |
728 |
||
729 |
if (results.isEmpty) None |
|
730 |
else {
|
|
731 |
val r = Text.Range(results.head.range.start, results.last.range.stop) |
|
732 |
val all_tips = |
|
| 81395 | 733 |
results.flatMap(_.messages).foldLeft(SortedMap.empty[Long, XML.Elem])(_ + _) |
| 72869 | 734 |
.iterator.map(_._2).toList ::: |
| 81204 | 735 |
results.flatMap(res => res.infos()) ::: |
736 |
results.flatMap(res => res.infos(important = false)).lastOption.toList |
|
| 65149 | 737 |
if (all_tips.isEmpty) None else Some(Text.Info(r, all_tips)) |
738 |
} |
|
739 |
} |
|
| 65911 | 740 |
|
741 |
||
| 71499 | 742 |
/* messages */ |
743 |
||
744 |
def warnings(range: Text.Range): List[Text.Markup] = |
|
745 |
snapshot.select(range, Rendering.warning_elements, _ => Some(_)).map(_.info) |
|
746 |
||
747 |
def errors(range: Text.Range): List[Text.Markup] = |
|
748 |
snapshot.select(range, Rendering.error_elements, _ => Some(_)).map(_.info) |
|
749 |
||
750 |
||
|
80949
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
751 |
/* comments */ |
|
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
752 |
|
|
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
753 |
def comments(range: Text.Range): List[Text.Markup] = |
|
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
754 |
snapshot.select(range, Rendering.comment_elements, _ => Some(_)).map(_.info) |
|
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
755 |
|
|
97924a26a5c3
add comments to rendering, e.g. to collect them from build database;
Fabian Huch <huch@in.tum.de>
parents:
80911
diff
changeset
|
756 |
|
| 65911 | 757 |
/* command status overview */ |
758 |
||
| 75393 | 759 |
def overview_color(range: Text.Range): Option[Rendering.Color.Value] = {
|
| 65911 | 760 |
if (snapshot.is_outdated) None |
761 |
else {
|
|
762 |
val results = |
|
| 68758 | 763 |
snapshot.cumulate[List[Markup]](range, Nil, Document_Status.Command_Status.liberal_elements, |
764 |
_ => |
|
765 |
{
|
|
766 |
case (status, Text.Info(_, elem)) => Some(elem.markup :: status) |
|
767 |
}, status = true) |
|
| 65911 | 768 |
if (results.isEmpty) None |
769 |
else {
|
|
| 68758 | 770 |
val status = Document_Status.Command_Status.make(results.iterator.flatMap(_.info)) |
| 65911 | 771 |
|
772 |
if (status.is_running) Some(Rendering.Color.running) |
|
773 |
else if (status.is_failed) Some(Rendering.Color.error) |
|
774 |
else if (status.is_warned) Some(Rendering.Color.warning) |
|
775 |
else if (status.is_unprocessed) Some(Rendering.Color.unprocessed) |
|
776 |
else None |
|
777 |
} |
|
778 |
} |
|
779 |
} |
|
| 67132 | 780 |
|
781 |
||
782 |
/* antiquoted text */ |
|
783 |
||
784 |
def antiquoted(range: Text.Range): Option[Text.Range] = |
|
785 |
snapshot.cumulate[Option[Text.Range]](range, None, Rendering.antiquoted_elements, _ => |
|
786 |
{
|
|
787 |
case (res, info) => if (res.isEmpty) Some(Some(info.range)) else None |
|
788 |
}).headOption.flatMap(_.info) |
|
| 69900 | 789 |
|
790 |
||
791 |
/* meta data */ |
|
792 |
||
| 75393 | 793 |
def meta_data(range: Text.Range): Properties.T = {
|
| 69900 | 794 |
val results = |
795 |
snapshot.cumulate[Properties.T](range, Nil, Rendering.meta_data_elements, _ => |
|
796 |
{
|
|
797 |
case (res, Text.Info(_, elem)) => |
|
798 |
val plain_text = XML.content(elem) |
|
799 |
Some((elem.name -> plain_text) :: res) |
|
800 |
}) |
|
801 |
Library.distinct(results.flatMap(_.info.reverse)) |
|
802 |
} |
|
|
70135
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
803 |
|
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
804 |
|
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
805 |
/* document tags */ |
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
806 |
|
| 75393 | 807 |
def document_tags(range: Text.Range): List[String] = {
|
|
70135
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
808 |
val results = |
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
809 |
snapshot.cumulate[List[String]](range, Nil, Rendering.document_tag_elements, _ => |
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
810 |
{
|
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
811 |
case (res, Text.Info(_, XML.Elem(Markup.Document_Tag(name), _))) => Some(name :: res) |
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
812 |
case _ => None |
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
813 |
}) |
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
814 |
Library.distinct(results.flatMap(_.info.reverse)) |
|
ad6d4a14adb5
report document tags as seen in the text (not the active tag of Thy_Output.present_thy);
wenzelm
parents:
69970
diff
changeset
|
815 |
} |
|
64622
529bbb8977c7
more uniform rendering for Isabelle/jEdit and Isabelle/VSCode;
wenzelm
parents:
diff
changeset
|
816 |
} |