b699086130ea86e0f4c2d68ef086b791962f2947
[roobuilder] / src / Builder4 / Editor.bjs
1 {
2  "build_module" : "builder",
3  "gen_extended" : false,
4  "items" : [
5   {
6    "# GtkSource.SearchContext searchcontext" : "null",
7    "# JsRender.JsRender? file" : "null",
8    "# JsRender.Node node" : "null",
9    "# JsRender.NodeProp? prop" : "null",
10    "# Xcls_MainWindow window" : "null",
11    "# bool dirty" : false,
12    "# bool pos" : false,
13    "# int last_error_counter" : 0,
14    "# int pos_root_x" : "",
15    "# int pos_root_y" : "",
16    "# string activeEditor" : "\"\"",
17    "$ homogeneous" : false,
18    "$ xns" : "Gtk",
19    "@ void save" : "()",
20    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
21    "bool hexpand" : true,
22    "bool vexpand" : true,
23    "int last_search_end" : 0,
24    "items" : [
25     {
26      "$ xns" : "Gtk",
27      "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
28      "bool shrink_end_child" : false,
29      "int width_request" : 200,
30      "items" : [
31       {
32        "$ xns" : "Gtk",
33        "* prop" : "start_child",
34        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
35        "int spacing" : 0,
36        "items" : [
37         {
38          "$ homogeneous" : false,
39          "$ xns" : "Gtk",
40          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
41          "bool hexpand" : true,
42          "bool vexpand" : false,
43          "items" : [
44           {
45            "$ xns" : "Gtk",
46            "bool vexpand" : true,
47            "id" : "save_button",
48            "label" : "Save",
49            "listeners" : {
50             "clicked" : [
51              " () => { ",
52              "    _this.saveContents();",
53              "}",
54              "  "
55             ]
56            },
57            "xtype" : "Button"
58           },
59           {
60            "$ xns" : "Gtk",
61            "Gtk.Justification justify" : "Gtk.Justification.LEFT",
62            "bool hexpand" : true,
63            "float xalign" : 0,
64            "id" : "helper",
65            "int margin_end" : 4,
66            "int margin_start" : 4,
67            "xtype" : "Label",
68            "| void setHelp" : [
69             "(Lsp.Hover? help) {",
70             "\tif (help == null || help.contents == null",
71             "\t\t|| help.contents.size < 1) {",
72             "\t\tthis.el.set_text(\"\");",
73             "\t\treturn;",
74             "\t}",
75             "\tvar sig = help.contents.get(0).value.split(\" \");",
76             "\tstring[] str = {};",
77             "\tfor(var i =0; i < sig.length; i++) {",
78             "\t",
79             "\t\tswitch(sig[i]) {",
80             "\t\t\tcase \"public\":",
81             "\t\t\tcase \"private\":",
82             "\t\t\tcase \"protected\":",
83             "\t\t\tcase \"async\":",
84             "\t\t\tcase \"class\":",
85             "\t\t\tcase \"{\":",
86             "\t\t\tcase \"}\":",
87             "\t\t\tcase \"(\":",
88             "\t\t\tcase \")\":",
89             "\t\t\t",
90             "\t\t\t\tstr += sig[i];",
91             "\t\t\t\tcontinue;",
92             "\t\t\t\t",
93             "\t\t\t\t",
94             "\t\t\tdefault:",
95             "\t",
96             "\t\t\t\tstr += (\"<span underline=\\\"single\\\" color=\\\"blue\\\" >\" + ",
97             "\t\t\t\t\tGLib.Markup.escape_text(sig[i])",
98             "\t\t\t\t\t+\"</span>\");",
99             "\t\t\tcontinue;",
100             "\t\t}",
101             "\t}",
102             "\tif (help.contents.size > 1) {",
103             "\t\tsig += (\"\\n\\n\"  + help.contents[1].value);",
104             "\t}",
105             "\t",
106             "\tthis.el.set_markup(string.joinv(\" \",str));",
107             "\t",
108             "}"
109            ]
110           },
111           {
112            "$ xns" : "Gtk",
113            "* ctor" : "new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL,6, 30, 1)",
114            "* init" : [
115             "{",
116             "\t//this.el.set_range(6,30);",
117             " \tthis.el.set_value ( BuilderApplication.settings.editor_font_size);",
118             " \tBuilderApplication.settings.editor_font_size_updated.connect(",
119             " \t\t() => {",
120             " \t\t\tBuilderApplication.settings.editor_font_size_inchange = true;",
121             " \t\t//\tGLib.debug(\"update range\");",
122             " \t\t \tthis.el.set_value (BuilderApplication.settings.editor_font_size);",
123             " \t\t \tBuilderApplication.settings.editor_font_size_inchange = false;",
124             " \t\t}",
125             "\t);",
126             "\t",
127             " ",
128             "}",
129             ""
130            ],
131            "bool draw_value" : false,
132            "bool has_origin" : true,
133            "bool sensitive" : true,
134            "int digits" : 0,
135            "int width_request" : 200,
136            "listeners" : {
137             "change_value" : [
138              "(st, val ) => {",
139              "\tif (BuilderApplication.settings.editor_font_size_inchange) {",
140              "\t\treturn false;",
141              "\t}",
142              "  \tBuilderApplication.settings.editor_font_size = val;",
143              " \treturn false;",
144              "}"
145             ]
146            },
147            "xtype" : "Scale"
148           },
149           {
150            "$ xns" : "Gtk",
151            "id" : "close_btn",
152            "items" : [
153             {
154              "$ xns" : "Gtk",
155              "* prop" : "child",
156              "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
157              "string icon_name" : "window-close",
158              "xtype" : "Image"
159             }
160            ],
161            "listeners" : {
162             "clicked" : [
163              " () => { ",
164              "    _this.saveContents();",
165              "    _this.window.windowstate.switchState(WindowState.State.PREVIEW);",
166              "}",
167              "  "
168             ]
169            },
170            "string icon_name" : "window-close",
171            "xtype" : "Button"
172           }
173          ],
174          "xtype" : "Box"
175         },
176         {
177          "$ xns" : "Gtk",
178          "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
179          "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
180          "bool overlay_scrolling" : false,
181          "bool vexpand" : true,
182          "id" : "RightEditor",
183          "items" : [
184           {
185            "# Gtk.CssProvider css" : "null",
186            "$ gboolean auto_indent" : true,
187            "$ xns" : "GtkSource",
188            "* init" : [
189             "",
190             " ",
191             "\t",
192             " ",
193             " ",
194             "this.el.completion.add_provider(",
195             "\tnew Palete.CompletionProvider(_this)",
196             ");",
197             "",
198             "// hover seems pretty useless.. - ??",
199             "//var hover = this.el.get_hover();",
200             "//hover.add_provider(new Palete.HoverProvider(_this));",
201             "",
202             "//this.el.completion.unblock_interactive();",
203             "this.el.completion.select_on_show = true; // select",
204             "//this.el.completion.remember_info_visibility\t = true;",
205             "",
206             "",
207             "var attrs = new GtkSource.MarkAttributes();",
208             "",
209             "attrs.set_icon_name ( \"process-stop\");    ",
210             "attrs.query_tooltip_text.connect(( mark) => {",
211             "     GLib.debug(\"tooltip query? %s\", mark.name);",
212             "    return strdup( mark.name);",
213             "});",
214             " attrs.query_tooltip_markup.connect(( mark) => {",
215             "     GLib.debug(\"tooltip query? %s\", mark.name);",
216             "    return strdup( mark.name);",
217             "});",
218             "this.el.set_mark_attributes (\"ERR\", attrs, 1);",
219             "attrs.ref();",
220             "",
221             "",
222             "var wattrs = new GtkSource.MarkAttributes();",
223             "wattrs.set_icon_name ( \"process-stop\");    ",
224             "wattrs.query_tooltip_text.connect(( mark) => {",
225             "     GLib.debug(\"tooltip query? %s\", mark.name);",
226             "    return strdup(mark.name);",
227             "});",
228             "wattrs.query_tooltip_markup.connect(( mark) => {",
229             "     GLib.debug(\"tooltip query? %s\", mark.name);",
230             "    return strdup(mark.name);",
231             "});",
232             "this.el.set_mark_attributes (\"WARN\", wattrs, 1);",
233             "wattrs.ref();",
234             "",
235             " ",
236             "var dattrs = new GtkSource.MarkAttributes();",
237             " ",
238             "dattrs.set_icon_name ( \"process-stop\"); ",
239             "",
240             "dattrs.query_tooltip_text.connect(( mark) => {",
241             "\tGLib.debug(\"tooltip query? %s\", mark.name);",
242             "    return strdup(mark.name);",
243             "});",
244             "//dattrs.query_tooltip_markup.connect(( mark) => {",
245             "//\tGLib.debug(\"tooltip query? %s\", mark.name);",
246             " //   return strdup(mark.name);",
247             "//});",
248             "this.el.set_mark_attributes (\"DEPR\", dattrs, 1);",
249             "dattrs.ref();    ",
250             "",
251             " this.el.get_space_drawer().set_matrix(null);",
252             " this.el.get_space_drawer().set_types_for_locations( ",
253             "\tGtkSource.SpaceLocationFlags.ALL,",
254             "\tGtkSource.SpaceTypeFlags.ALL",
255             ");",
256             "this.el.get_space_drawer().set_enable_matrix(true);",
257             ""
258            ],
259            "* prop" : "child",
260            "bool has_tooltip" : true,
261            "bool hexpand" : true,
262            "bool insert_spaces_instead_of_tabs" : true,
263            "bool vexpand" : true,
264            "boolean show_line_marks" : true,
265            "boolean show_line_numbers" : true,
266            "css_classes" : "{ \"code-editor\" }",
267            "gboolean highlight_current_line" : true,
268            "id" : "view",
269            "indent_width" : 4,
270            "items" : [
271             {
272              "$ Gee.HashMap<int,string>? xmarks" : "null",
273              "$ xns" : "GtkSource",
274              "$ xtype" : "Buffer",
275              "* init" : [
276               "",
277               "var buf = this.el;",
278               "buf.create_tag (\"bold\", \"weight\", Pango.Weight.BOLD);",
279               "buf.create_tag (\"type\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#204a87\");",
280               "buf.create_tag (\"keyword\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#a40000\");",
281               "buf.create_tag (\"text\", \"weight\", Pango.Weight.NORMAL, \"foreground\", \"#729fcf\");",
282               "buf.create_tag (\"number\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#ad7fa8\");",
283               "buf.create_tag (\"method\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#729fcf\");",
284               "buf.create_tag (\"property\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#BC1F51\");",
285               "buf.create_tag (\"variable\", \"weight\", Pango.Weight.BOLD, \"foreground\", \"#A518B5\");",
286               "",
287               "",
288               "buf.create_tag (\"ERR\", \"weight\", Pango.Weight.BOLD, \"background\", \"pink\");",
289               "buf.create_tag (\"WARN\", \"weight\", Pango.Weight.BOLD, \"background\", \"#ABF4EB\");",
290               "buf.create_tag (\"DEPR\", \"weight\", Pango.Weight.BOLD, \"background\", \"#EEA9FF\");",
291               "",
292               "",
293               ""
294              ],
295              "* prop" : "buffer",
296              "bool check_queued" : false,
297              "bool enable_undo" : true,
298              "bool highlight_matching_brackets" : true,
299              "bool highlight_syntax" : true,
300              "id" : "buffer",
301              "int error_line" : "-1",
302              "listeners" : {
303               "changed" : [
304                " () => {",
305                "    // check syntax??",
306                "    // ??needed..??",
307                "    _this.save_button.el.sensitive = true;",
308                "    print(\"EDITOR CHANGED\");",
309                "    this.checkSyntax();",
310                "   ",
311                "    _this.dirty = true;",
312                "",
313                "    // this.get('/LeftPanel.model').changed(  str , false);",
314                "    return ;",
315                "}",
316                ""
317               ],
318               "cursor_moved" : [
319                "( ) => {",
320                "",
321                "\tGtk.TextIter iter;",
322                "\tthis.el.get_iter_at_offset (",
323                "\t\t\tout iter, this.el.cursor_position);",
324                "",
325                "\t_this.navigation.updateSelectedLine(",
326                "\t\t\t(uint)iter.get_line(),",
327                "\t\t\t(uint)iter.get_line_offset()",
328                "\t\t);",
329                "\tthis.showHelp(iter);",
330                "",
331                "}",
332                ""
333               ]
334              },
335              "| bool OLDhighlightErrorsJson" : [
336               "(string type, Json.Object obj) {",
337               "\tGtk.TextIter start;",
338               "\tGtk.TextIter end;     ",
339               "\tthis.el.get_bounds (out start, out end);",
340               "",
341               "\tthis.el.remove_source_marks (start, end, type);",
342               "\tGLib.debug(\"highlight errors\");\t\t ",
343               "",
344               "\t // we should highlight other types of errors..",
345               "",
346               "\tif (!obj.has_member(type)) {",
347               "\t\tGLib.debug(\"Return has no errors\\n\");",
348               "\t\treturn true;",
349               "\t}",
350               "",
351               "\tif (_this.window.windowstate.state != WindowState.State.CODEONLY ",
352               "\t\t&&",
353               "\t\t_this.window.windowstate.state != WindowState.State.CODE",
354               "\t\t) {",
355               "\t\tGLib.debug(\"windowstate != CODEONLY?\");",
356               "\t\t",
357               "\t\treturn true;",
358               "\t} ",
359               "",
360               "\t//this.marks = new Gee.HashMap<int,string>();",
361               "\tvar err = obj.get_object_member(type);",
362               " ",
363               "\tif (_this.file == null) {",
364               "\t\tGLib.debug(\"file is null?\");",
365               "\t\treturn true;",
366               "",
367               "\t}",
368               "\tvar valafn = _this.file.path;",
369               "",
370               "\tif (_this.file.xtype != \"PlainFile\") {",
371               "",
372               "\t\tvalafn = \"\";",
373               "\t\ttry {             ",
374               "\t\t\tvar  regex = new Regex(\"\\\\.bjs$\");",
375               "\t\t\t// should not happen",
376               "\t      \t\tvalafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");",
377               "\t\t} catch (GLib.RegexError e) {",
378               "\t\t\treturn true;",
379               "\t\t}   ",
380               "",
381               "",
382               "",
383               "\t}",
384               "\tif (!err.has_member(valafn)) {",
385               "\t\tGLib.debug(\"File path has no errors\");",
386               "\t\treturn  true;",
387               "\t}",
388               "",
389               "\tvar lines = err.get_object_member(valafn);",
390               "\t",
391               "\tvar offset = 1;",
392               "\tif (obj.has_member(\"line_offset\")) { // ?? why??",
393               "\t\toffset = (int)obj.get_int_member(\"line_offset\") + 1;",
394               "\t}",
395               "",
396               "",
397               "\tvar tlines = this.el.get_line_count () +1;",
398               "\t",
399               "\tif (_this.prop != null) {",
400               "\t",
401               "\t\ttlines = _this.prop.end_line + 1;",
402               "\t\toffset = _this.prop.start_line + 1;",
403               "\t",
404               "\t}",
405               "\t",
406               "",
407               "",
408               "\tlines.foreach_member((obj, line, node) => {",
409               "\t\t",
410               "\t     Gtk.TextIter iter;",
411               "//        print(\"get inter\\n\");",
412               "\t    var eline = int.parse(line) - offset;",
413               "\t    GLib.debug(\"GOT ERROR on line %s -- converted to %d  (offset = %d)\\n\", line,eline, offset);",
414               "\t    ",
415               "\t    ",
416               "\t    if (eline > tlines || eline < 0) {",
417               "\t        return;",
418               "\t    }",
419               "\t   ",
420               "\t    ",
421               "\t    this.el.get_iter_at_line( out iter, eline);",
422               "\t    //print(\"mark line\\n\");",
423               "\t    var msg  = \"\";",
424               "\t    var ar = lines.get_array_member(line);",
425               "\t    for (var i = 0 ; i < ar.get_length(); i++) {",
426               "\t    \tif (ar.get_string_element(i) == \"Success\") {",
427               "\t    \t\tcontinue;",
428               "    \t\t}",
429               "\t\t\tmsg += (msg.length > 0) ? \"\\n\" : \"\";",
430               "\t\t\tmsg += ar.get_string_element(i);",
431               "\t\t}",
432               "\t\tif (msg == \"\") {",
433               "\t\t\treturn;",
434               "\t\t}",
435               "\t\tmsg = \"Line: %d\".printf(eline+1) +  \" \" + msg;",
436               "\t    this.el.create_source_mark(msg, type, iter);",
437               "\t    GLib.debug(\"set line %d to %m\", eline, msg);",
438               "\t   // this.marks.set(eline, msg);",
439               "\t} );",
440               "\treturn false;",
441               "",
442               "",
443               "",
444               "",
445               "",
446               "\t}",
447               ""
448              ],
449              "| bool checkSyntax" : [
450               " () {",
451               " ",
452               "    ",
453               "    var str = this.toString();",
454               "    ",
455               "    // needed???",
456               "    if (this.error_line > 0) {",
457               "         Gtk.TextIter start;",
458               "         Gtk.TextIter end;     ",
459               "        this.el.get_bounds (out start, out end);",
460               "",
461               "        this.el.remove_source_marks (start, end, null);",
462               "    }",
463               "    if (str.length < 1) {",
464               "        print(\"checkSyntax - empty string?\\n\");",
465               "        return true;",
466               "    }",
467               "    ",
468               "    // bit presumptiona",
469               "    if (_this.file.xtype == \"PlainFile\") {",
470               "    ",
471               "        // assume it's gtk...",
472               "         var  oldcode =_this.file.toSource();",
473               "        _this.file.setSource(str);",
474               "\t    BuilderApplication.showSpinner(\"appointment soon\",\"document change pending\");",
475               "    \t_this.file.getLanguageServer().document_change(_this.file);",
476               "\t\t_this.file.getLanguageServer().queueDocumentSymbols(_this.file);",
477               "        _this.file.setSource(oldcode);",
478               "        ",
479               "\t\t ",
480               "        return true;",
481               "    ",
482               "    }",
483               "   if (_this.file == null) {",
484               "       return true;",
485               "   }",
486               " ",
487               "    ",
488               "",
489               "      ",
490               "     ",
491               "    GLib.debug(\"calling validate\");    ",
492               "    // clear the buttons.",
493               " \tif (_this.prop.name == \"xns\" || _this.prop.name == \"xtype\") {",
494               "\t\treturn true ;",
495               "\t}",
496               "\tvar oldcode  = _this.prop.val;",
497               "\t",
498               "\t_this.prop.val = str;",
499               "\t_this.node.updated_count++;",
500               "    _this.file.getLanguageServer().document_change(_this.file);",
501               "    _this.node.updated_count++;",
502               "    _this.prop.val = oldcode;",
503               "    ",
504               "    ",
505               "    //print(\"done mark line\\n\");",
506               "     ",
507               "    return true; // at present allow saving - even if it's invalid..",
508               "}",
509               ""
510              ],
511              "| bool highlightErrors" : [
512               "( Gee.HashMap<int,string> validate_res) {",
513               "         ",
514               "\tthis.error_line = validate_res.size;",
515               "",
516               "\tif (this.error_line < 1) {",
517               "\t\treturn true;",
518               "\t}",
519               "\tvar tlines = this.el.get_line_count ();",
520               "\tGtk.TextIter iter;",
521               "\tvar valiter = validate_res.map_iterator();",
522               "\twhile (valiter.next()) {",
523               "",
524               "\t//        print(\"get inter\\n\");",
525               "\t\tvar eline = valiter.get_key();",
526               "\t\tif (eline > tlines) {",
527               "\t\t\tcontinue;",
528               "\t\t}",
529               "\t\tthis.el.get_iter_at_line( out iter, eline);",
530               "\t\t//print(\"mark line\\n\");",
531               "\t\tthis.el.create_source_mark(valiter.get_value(), \"ERR\", iter);",
532               "\t}   ",
533               "\treturn false;",
534               "}"
535              ],
536              "| string toString" : [
537               "  () {",
538               "    ",
539               "    Gtk.TextIter s;",
540               "    Gtk.TextIter e;",
541               "    this.el.get_start_iter(out s);",
542               "    this.el.get_end_iter(out e);",
543               "    var ret = this.el.get_text(s,e,true);",
544               "    //print(\"TO STRING? \" + ret);",
545               "    return ret;",
546               "}",
547               " "
548              ],
549              "| void showHelp" : [
550               "(Gtk.TextIter iter) {",
551               "\tvar back = iter.copy();",
552               "\tback.backward_char();",
553               "\t",
554               "\tvar forward = iter.copy();",
555               "\tforward.forward_char();",
556               "\t",
557               "\t// what's the character at the iter?",
558               "\tvar str = back.get_text(iter);",
559               "\tstr += iter.get_text(forward);",
560               "\tif (str.strip().length < 1) {",
561               "\t\treturn;",
562               "\t}",
563               "\tvar offset = iter.get_line_offset();",
564               "\tvar line = iter.get_line();",
565               "\tif (_this.prop != null) {",
566               "\t\t\t\t// ",
567               "\t\tline += _this.prop.start_line ; ",
568               "\t\t\t\t\t// this is based on Gtk using tabs (hence 1/2 chars);",
569               "\t\toffset += _this.node.node_pad.length;",
570               "\t\t\t\t\t// javascript listeners are indented 2 more spaces.",
571               "\t\tif (_this.prop.ptype == JsRender.NodePropType.LISTENER) {",
572               "\t\t\toffset += 2;",
573               "\t\t}",
574               "\t} ",
575               "\t",
576               "\tvar ls = _this.file.getLanguageServer();",
577               "\tls.hover.begin(",
578               "\t\t_this.file, line, offset,",
579               "\t\t( a, o)  => {",
580               "\t\t\ttry {",
581               "\t\t\t\tvar res = ls.hover.end(o );",
582               "\t\t\t",
583               "\t\t\t\t_this.helper.setHelp(res);",
584               "\t\t\t} catch (GLib.Error e) {",
585               "\t\t\t\t// noop..",
586               "\t\t\t}",
587               "\t\t});",
588               "}\t",
589               "\t\t ",
590               ""
591              ]
592             },
593             {
594              "# bool is_control" : false,
595              "$ xns" : "Gtk",
596              "id" : "keystate",
597              "listeners" : {
598               "key_pressed" : [
599                "(keyval, keycode, state) => {",
600                "",
601                " \tif (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
602                " \t\tthis.is_control = true;",
603                "\t}",
604                "\treturn false;",
605                "}",
606                ""
607               ],
608               "key_released" : [
609                "(keyval, keycode, state) => {",
610                "",
611                " \t if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {",
612                " \t\tthis.is_control = false;",
613                "\t}",
614                "    if (keyval == Gdk.Key.s && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
615                "        GLib.debug(\"SAVE: ctrl-S  pressed\");",
616                "        _this.saveContents();",
617                "        return;",
618                "    }",
619                "    ",
620                "    if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
621                "\t    GLib.debug(\"SAVE: ctrl-g  pressed\");",
622                "\t\t_this.forwardSearch(true);",
623                "\t    return;",
624                "\t}",
625                "\tif (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
626                "\t    GLib.debug(\"SAVE: ctrl-f  pressed\");",
627                "\t\t_this.search_entry.el.grab_focus();",
628                "\t\t_this.search_entry.el.select_region(0,-1);",
629                "\t    return;",
630                "\t}",
631                "\tif (keyval == Gdk.Key.space && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
632                "\t\t_this.view.el.show_completion();",
633                "\t}",
634                "\t",
635                "\tGtk.TextIter iter;",
636                "\t_this.buffer.el.get_iter_at_offset( out iter, _this.buffer.el.cursor_position);  ",
637                "\tvar line  = iter.get_line();",
638                "\tvar offset = iter.get_line_offset();",
639                "\tGLib.debug(\"line  %d  off %d\", line ,offset);",
640                "\tif (_this.prop != null) {",
641                "\t\tline += _this.prop.start_line + 1; // i think..",
642                "\t\toffset += 12; // should probably be 8 without namespaced ",
643                "\t\tGLib.debug(\"guess line  %d  off %d\", line ,offset);",
644                "\t} ",
645                "    //_this.view.el.show_completion();",
646                "   // print(event.key.keyval)",
647                "    ",
648                "    ",
649                "    return;",
650                " ",
651                " ",
652                "}",
653                ""
654               ]
655              },
656              "xtype" : "EventControllerKey"
657             },
658             {
659              "# double distance" : "0.0f",
660              "$ xns" : "Gtk",
661              "Gtk.EventControllerScrollFlags flags" : "Gtk.EventControllerScrollFlags.VERTICAL",
662              "listeners" : {
663               "scroll" : [
664                "(dx, dy) => {",
665                "\tif (!_this.keystate.is_control) {",
666                "\t\treturn false;",
667                "\t}",
668                "\t //GLib.debug(\"scroll %f\",  dy);",
669                "\t",
670                "\tthis.distance += dy;",
671                "\t",
672                "\t//GLib.debug(\"scroll %f / %f\",  dy, this.distance);",
673                " ",
674                "\t if (this.distance < -1) {",
675                " ",
676                "\t\tBuilderApplication.settings.editor_font_size ++;",
677                "\t\tthis.distance = 0;",
678                "\t}",
679                "\tif (this.distance > 1) {",
680                "\t\tBuilderApplication.settings.editor_font_size --;",
681                "\t\tthis.distance = 0;",
682                "\t}",
683                "\t ",
684                "\treturn true;",
685                "}",
686                ""
687               ]
688              },
689              "xtype" : "EventControllerScroll"
690             },
691             {
692              "$ xns" : "Gtk",
693              "listeners" : {
694               "pressed" : [
695                "(n_press, x, y) => {",
696                "\tGtk.TextIter iter;",
697                "\tint  buffer_x, buffer_y;",
698                "\tvar gut = _this.view.el.get_gutter(Gtk.TextWindowType.LEFT);",
699                "\t",
700                "\t _this.view.el.window_to_buffer_coords (Gtk.TextWindowType.TEXT,",
701                "\t\t(int)x - gut.get_width(),  (int)y,",
702                "  \t\tout  buffer_x, out  buffer_y);",
703                "\t_this.view.el.get_iter_at_location (out  iter,  ",
704                "\t\t\tbuffer_x,  buffer_y);;",
705                "\t",
706                "\t",
707                "\tif (_this.buffer.el.iter_has_context_class(iter, \"comment\") ||",
708                "\t\t_this.buffer.el.iter_has_context_class(iter, \"string\")",
709                "\t) { ",
710                "\t\treturn ;",
711                "\t}",
712                "\t_this.buffer.showHelp(iter);",
713                "\t ",
714                "\t\t ",
715                " ",
716                "}",
717                ""
718               ]
719              },
720              "xtype" : "GestureClick"
721             }
722            ],
723            "listeners" : {
724             "query_tooltip" : [
725              "(x, y, keyboard_tooltip, tooltip) => {",
726              "\t",
727              "\t//GLib.debug(\"query tooltip\");",
728              "\tGtk.TextIter iter;",
729              "\tint trailing;",
730              "\t",
731              "\tvar yoff = (int) _this.RightEditor.el.vadjustment.value;",
732              "\t",
733              "\t// I think this is problematic - if it's compliing  / updating at same time as query.",
734              "\t",
735              "\t//if (_this.window.statusbar_compile_spinner.el.spinning) {",
736              "\t//\treturn false;",
737              "\t//}",
738              "\t",
739              "\tthis.el.get_iter_at_position (out iter, out trailing,  x,  y + yoff);",
740              "\t ",
741              "\tvar l = iter.get_line();",
742              "",
743              "\t",
744              "\t ",
745              "\t// GLib.debug(\"query tooltip line %d\", (int) l);",
746              "\tif (l < 0) {",
747              "",
748              "\t\treturn false;",
749              "\t}",
750              "\t/*",
751              "\tif (_this.buffer.marks != null && _this.buffer.marks.has_key(l)) {",
752              "\t\tGLib.debug(\"line %d setting tip to %s\", l,  _this.buffer.marks.get(l));",
753              "\t\ttooltip.set_text(_this.buffer.marks.get(l).dup());",
754              "\t\treturn true;",
755              "\t}",
756              " ",
757              "\treturn false;",
758              "\t*/",
759              "\t",
760              "\t  ",
761              "\t// this crashes?? - not sure why.",
762              "\tvar marks = _this.buffer.el.get_source_marks_at_line(l, \"ERR\");",
763              "\tif (marks.is_empty()) {",
764              "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"WARN\");",
765              "\t}",
766              "\tif (marks.is_empty()) {",
767              "\t\tmarks = _this.buffer.el.get_source_marks_at_line(l, \"DEPR\");",
768              "\t}",
769              "\t",
770              "\t// GLib.debug(\"query tooltip line %d marks %d\", (int)l, (int) marks.length());",
771              "\tvar str = \"\";",
772              "\tmarks.@foreach((m) => { ",
773              "\t\t//GLib.debug(\"got mark %s\", m.name);",
774              "\t\tstr += (str.length > 0 ? \"\\n\" : \"\") + m.category + \": \" + m.name;",
775              "\t});",
776              "\t// true if there is a mark..",
777              "\tif (str.length > 0 ) {",
778              "\t\ttooltip.set_text( str );",
779              "\t}",
780              "\treturn str.length > 0 ? true : false;",
781              "\t ",
782              "}",
783              ""
784             ]
785            },
786            "string name" : "editor-view",
787            "uint tab_width" : 4,
788            "xtype" : "View",
789            "| void load" : [
790             " (string str) {",
791             "",
792             "// show the help page for the active node..",
793             "   //this.get('/Help').show();",
794             " ",
795             "  // this.get('/BottomPane').el.set_current_page(0);",
796             "  \tGLib.debug(\"load called - Reset undo buffer\");",
797             "  \t",
798             "    var buf = (GtkSource.Buffer)this.el.get_buffer();",
799             "    buf.begin_irreversible_action();",
800             "    buf.set_text(str, str.length);",
801             "    buf.end_irreversible_action();",
802             "    ",
803             "    var lm = GtkSource.LanguageManager.get_default();",
804             "    var lang = \"vala\";",
805             "    if (_this.file != null) {",
806             "         lang = _this.file.language;",
807             "    }",
808             "    print(\"lang=%s, content_type = %s\\n\", lang, _this.file.content_type);",
809             "    var lg = _this.file.content_type.length > 0  ?",
810             "            lm.guess_language(_this.file.path, _this.file.content_type) :",
811             "            lm.get_language(lang);",
812             "     ",
813             "   ",
814             "    ((GtkSource.Buffer)(this.el.get_buffer())) .set_language(lg); ",
815             "",
816             "    this.el.insert_spaces_instead_of_tabs = true;",
817             "    if (lg != null) {",
818             "\t\tprint(\"sourcelanguage  = %s\\n\", lg.name);",
819             "\t\tif (lg.name == \"Vala\") {",
820             "\t\t    this.el.insert_spaces_instead_of_tabs = false;",
821             "\t\t}",
822             "     }",
823             "    _this.dirty = false;",
824             "    this.el.grab_focus();",
825             "    _this.save_button.el.sensitive = false;",
826             "    _this.last_error_counter = -1;",
827             "}"
828            ]
829           }
830          ],
831          "xtype" : "ScrolledWindow"
832         },
833         {
834          "$ xns" : "Gtk",
835          "* pack" : "append",
836          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
837          "bool homogeneous" : false,
838          "bool vexpand" : false,
839          "int spacing" : 0,
840          "items" : [
841           {
842            "$ xns" : "Gtk",
843            "Gtk.CssProvider css" : "",
844            "bool hexpand" : true,
845            "id" : "search_entry",
846            "items" : [
847             {
848              "$ xns" : "Gtk",
849              "listeners" : {
850               "key_pressed" : [
851                "(keyval, keycode, state) => {",
852                "",
853                "\tif (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {",
854                "\t    GLib.debug(\"SAVE: ctrl-g  pressed\");",
855                "\t\t_this.forwardSearch(true);",
856                "\t    return true;",
857                "\t}",
858                "    ",
859                "  ",
860                " \tif (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {",
861                "\t\t_this.forwardSearch(true);",
862                "\t\t",
863                "\t\t",
864                "\t    return true;",
865                "",
866                "\t}    ",
867                "   // print(event.key.keyval)",
868                "   ",
869                "    return false;",
870                "}",
871                ""
872               ]
873              },
874              "xtype" : "EventControllerKey"
875             }
876            ],
877            "listeners" : {
878             "search_changed" : [
879              "( ) => {",
880              "",
881              "_this.search(_this.search_entry.el.text);",
882              "\t _this.search_results.updateResults();",
883              "",
884              "\tGLib.Timeout.add_seconds(1,() => {",
885              "\t\t _this.search_results.updateResults();",
886              "\t\t return false;",
887              "\t });",
888              "}",
889              ""
890             ]
891            },
892            "string name" : "editor-search-entry",
893            "string placeholder_text" : "Press enter to search",
894            "uint search_delay" : 3,
895            "xtype" : "SearchEntry",
896            "| void forwardSearch" : [
897             "(bool change_focus) {",
898             "",
899             "",
900             "\t_this.forwardSearch(change_focus);",
901             "",
902             "/*",
903             "",
904             "\tswitch(_this.windowstate.state) {",
905             "\t\tcase WindowState.State.CODEONLY:",
906             "\t\t//case WindowState.State.CODE:",
907             "\t\t\t// search the code being edited..",
908             "\t\t\t_this.windowstate.code_editor_tab.forwardSearch(change_focus);",
909             "\t\t\t ",
910             "\t\t\tbreak;",
911             "\t\tcase WindowState.State.PREVIEW:",
912             "\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {",
913             "\t\t\t\t_this.windowstate.window_gladeview.forwardSearch(change_focus);",
914             "\t\t\t} else { ",
915             "\t\t\t\t _this.windowstate.window_rooview.forwardSearch(change_focus);",
916             "\t\t\t}",
917             "\t\t",
918             "\t\t\tbreak;",
919             "\t}",
920             "\t*/",
921             "\t",
922             "}",
923             ""
924            ]
925           },
926           {
927            "$ xns" : "Gtk",
928            "id" : "search_results",
929            "int margin_end" : 4,
930            "int margin_start" : 4,
931            "string label" : "No Results",
932            "xtype" : "Label",
933            "| void updateResults" : [
934             "() {",
935             "\tthis.el.visible = true;",
936             "\t",
937             "\tvar res = _this.searchcontext.get_occurrences_count();",
938             "\tif (res < 0) {",
939             "\t\t_this.search_results.el.label = \"??? Matches\";\t\t",
940             "\t\treturn;",
941             "\t}",
942             "",
943             "\t_this.nextBtn.el.sensitive = false;",
944             "\t_this.backBtn.el.sensitive = false;\t",
945             "",
946             "\tif (res > 0) {",
947             "\t\t_this.search_results.el.label = \"%d Matches\".printf(res);",
948             "\t\t_this.nextBtn.el.sensitive = true;",
949             "\t\t_this.backBtn.el.sensitive = true;",
950             "\t\treturn;",
951             "\t} ",
952             "\t_this.search_results.el.label = \"No Matches\";",
953             "\t",
954             "}"
955            ]
956           },
957           {
958            "$ xns" : "Gtk",
959            "bool always_show_image" : true,
960            "bool sensitive" : false,
961            "id" : "nextBtn",
962            "listeners" : {
963             "clicked" : [
964              "(event) => {",
965              "",
966              "\t_this.forwardSearch(true);",
967              "\t",
968              "\t ",
969              "}",
970              ""
971             ]
972            },
973            "string icon_name" : "go-down",
974            "xtype" : "Button"
975           },
976           {
977            "$ xns" : "Gtk",
978            "bool always_show_image" : true,
979            "bool sensitive" : false,
980            "id" : "backBtn",
981            "listeners" : {
982             "clicked" : [
983              "(event) => {",
984              "",
985              "\t_this.backSearch(true);",
986              "\t ",
987              "}",
988              ""
989             ]
990            },
991            "string icon_name" : "go-up",
992            "xtype" : "Button"
993           },
994           {
995            "$ xns" : "Gtk",
996            "bool always_show_arrow" : true,
997            "bool always_show_image" : true,
998            "items" : [
999             {
1000              "$ xns" : "Gtk",
1001              "* prop" : "popover",
1002              "id" : "search_settings",
1003              "items" : [
1004               {
1005                "$ xns" : "Gtk",
1006                "* prop" : "child",
1007                "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
1008                "int spacing" : 0,
1009                "items" : [
1010                 {
1011                  "$ xns" : "Gtk",
1012                  "* init" : [
1013                   "{",
1014                   "\tthis.el.show();",
1015                   "}",
1016                   ""
1017                  ],
1018                  "id" : "case_sensitive",
1019                  "string label" : "Case Sensitive",
1020                  "xtype" : "CheckButton"
1021                 },
1022                 {
1023                  "$ xns" : "Gtk",
1024                  "* init" : [
1025                   "{",
1026                   "\tthis.el.show();",
1027                   "}",
1028                   ""
1029                  ],
1030                  "id" : "regex",
1031                  "string label" : "Regex",
1032                  "xtype" : "CheckButton"
1033                 },
1034                 {
1035                  "$ xns" : "Gtk",
1036                  "id" : "multiline",
1037                  "string label" : "Multi-line (add \\n)",
1038                  "xtype" : "CheckButton"
1039                 }
1040                ],
1041                "xtype" : "Box"
1042               }
1043              ],
1044              "xtype" : "Popover"
1045             }
1046            ],
1047            "string icon_name" : "emblem-system",
1048            "xtype" : "MenuButton"
1049           }
1050          ],
1051          "xtype" : "Box"
1052         }
1053        ],
1054        "xtype" : "Box"
1055       },
1056       {
1057        "$ xns" : "Gtk",
1058        "* prop" : "end_child",
1059        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
1060        "bool hexpand" : true,
1061        "bool vexpand" : true,
1062        "int spacing" : 0,
1063        "items" : [
1064         {
1065          "$ xns" : "Gtk",
1066          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1067          "int spacing" : 0,
1068          "xtype" : "Box"
1069         },
1070         {
1071          "$ xns" : "Gtk",
1072          "bool hexpand" : true,
1073          "bool vexpand" : true,
1074          "bool visible" : false,
1075          "id" : "navigationwindow",
1076          "items" : [
1077           {
1078            "# int last_selected_line" : "-1",
1079            "$ Gtk.Widget? selected_row" : "null",
1080            "$ xns" : "Gtk",
1081            "* prop" : "child",
1082            "id" : "navigation",
1083            "items" : [
1084             {
1085              "$ xns" : "Gtk",
1086              "bool expand" : true,
1087              "items" : [
1088               {
1089                "$ xns" : "Gtk",
1090                "* prop" : "factory",
1091                "listeners" : {
1092                 "bind" : [
1093                  "(listitem) => {",
1094                  "\t ",
1095                  "\t// GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
1096                  "\t",
1097                  "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
1098                  "\tvar expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();",
1099                  "\t ",
1100                  "\t ",
1101                  "\tvar hbox = (Gtk.Box) expand.child;",
1102                  " ",
1103                  "\t",
1104                  "\tvar img = (Gtk.Image) hbox.get_first_child();",
1105                  "\tvar lbl = (Gtk.Label) img.get_next_sibling();",
1106                  "\t",
1107                  "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
1108                  "\tvar sym = (Lsp.DocumentSymbol) lr.get_item();",
1109                  "\t",
1110                  "\tsym.set_data<Gtk.Widget>(\"widget\", expand.get_parent());",
1111                  "\texpand.get_parent().get_parent().set_data<Lsp.DocumentSymbol>(\"symbol\", sym);",
1112                  "\t",
1113                  "\t//GLib.debug(\"save sym on %s\", expand.get_parent().get_parent().get_type().name());",
1114                  "\t",
1115                  "\t//GLib.debug(\"got %d children for %s\" , (int)sym.children.get_n_items(), sym.name);",
1116                  "    ",
1117                  "    expand.set_hide_expander( sym.children.get_n_items()  < 1);",
1118                  " \texpand.set_list_row(lr);",
1119                  " \t//this.in_bind = true;",
1120                  " \t// default is to expand",
1121                  " ",
1122                  " \t//this.in_bind = false;",
1123                  " \t",
1124                  " \tsym.bind_property(\"symbol_icon\",",
1125                  "                    img, \"icon_name\",",
1126                  "                   GLib.BindingFlags.SYNC_CREATE);",
1127                  " \t",
1128                  " \thbox.css_classes = { sym.symbol_icon };",
1129                  " \t",
1130                  " \tsym.bind_property(\"name\",",
1131                  "                    lbl, \"label\",",
1132                  "                   GLib.BindingFlags.SYNC_CREATE);",
1133                  " \t// should be better?- --line no?",
1134                  " \tsym.bind_property(\"tooltip\",",
1135                  "                    lbl, \"tooltip_markup\",",
1136                  "                   GLib.BindingFlags.SYNC_CREATE);",
1137                  " \t// bind image...",
1138                  " \t",
1139                  "}",
1140                  ""
1141                 ],
1142                 "setup" : [
1143                  "(listitem) => {",
1144                  "\t",
1145                  "\tvar expand = new Gtk.TreeExpander();",
1146                  "\t ",
1147                  "\texpand.set_indent_for_depth(true);",
1148                  "\texpand.set_indent_for_icon(true);",
1149                  "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
1150                  "\tvar icon = new Gtk.Image();",
1151                  "\tvar lbl = new Gtk.Label(\"\");",
1152                  "\tlbl.use_markup = true;",
1153                  "\tlbl.ellipsize = Pango.EllipsizeMode.END;",
1154                  "\t",
1155                  "\ticon.margin_end = 4;",
1156                  " \tlbl.justify = Gtk.Justification.LEFT;",
1157                  " \tlbl.xalign = 0;",
1158                  "",
1159                  "//\tlistitem.activatable = true; ??",
1160                  "\t",
1161                  "\thbox.append(icon);",
1162                  "\thbox.append(lbl);",
1163                  "\texpand.set_child(hbox);",
1164                  "\t((Gtk.ListItem)listitem).set_child(expand);",
1165                  "\t",
1166                  "}",
1167                  ""
1168                 ]
1169                },
1170                "xtype" : "SignalListItemFactory"
1171               }
1172              ],
1173              "string title" : "Code Navigation",
1174              "xtype" : "ColumnViewColumn"
1175             },
1176             {
1177              "$ xns" : "Gtk",
1178              "* prop" : "model",
1179              "id" : "navigationselmodel",
1180              "items" : [
1181               {
1182                "$ xns" : "Gtk",
1183                "* prop" : "model",
1184                "id" : "navigationsort",
1185                "items" : [
1186                 {
1187                  "$ Gtk.TreeListModelCreateModelFunc create_func" : [
1188                   "(item) => {",
1189                   " ",
1190                   "\treturn ((Lsp.DocumentSymbol)item).children;",
1191                   "}",
1192                   ""
1193                  ],
1194                  "$ xns" : "Gtk",
1195                  "* prop" : "model",
1196                  "bool autoexpand" : true,
1197                  "bool passthrough" : false,
1198                  "items" : [
1199                   {
1200                    "$ GLib.Type item_type" : "typeof(Lsp.DocumentSymbol)",
1201                    "$ xns" : "GLib",
1202                    "* prop" : "root",
1203                    "id" : "navliststore",
1204                    "xtype" : "ListStore",
1205                    "| Lsp.DocumentSymbol? symbolAtLine" : [
1206                     "(uint line, uint chr) {",
1207                     " ",
1208                     "\t",
1209                     "\tfor(var i = 0; i < this.el.get_n_items();i++) {",
1210                     "\t\tvar el = (Lsp.DocumentSymbol)this.el.get_item(i);",
1211                     "\t\t//GLib.debug(\"Check sym %s : %d-%d\",",
1212                     "\t\t//\tel.name , (int)el.range.start.line,",
1213                     "\t\t//\t(int)el.range.end.line",
1214                     "\t\t//);",
1215                     "\t\tvar ret = el.containsLine(line,chr);",
1216                     "\t\tif (ret != null) {",
1217                     "\t\t\treturn ret;",
1218                     "\t\t}",
1219                     "\t\t",
1220                     "\t}",
1221                     "\t",
1222                     "\treturn null;",
1223                     "}"
1224                    ]
1225                   }
1226                  ],
1227                  "listeners" : {
1228                   "items_changed" : [
1229                    "(position, removed, added) => {",
1230                    "\tGLib.debug(\"tree item changed %d , %d , %d\",(int) position, (int)removed, (int) added);",
1231                    "\t if (added < 1) { ",
1232                    "\t \treturn;",
1233                    " \t}",
1234                    "\t//var sym = (Lsp.DocumentSymbol) this.el.get_item(position);",
1235                    "\tvar row = this.el.get_row(position);",
1236                    "\t",
1237                    "\tGLib.debug(\"got %s\", row.get_item().get_type().name());",
1238                    "\t",
1239                    "",
1240                    "}",
1241                    ""
1242                   ]
1243                  },
1244                  "xtype" : "TreeListModel"
1245                 },
1246                 {
1247                  "$ xns" : "Gtk",
1248                  "* prop" : "sorter",
1249                  "items" : [
1250                   {
1251                    "$ xns" : "Gtk",
1252                    "* prop" : "sorter",
1253                    "items" : [
1254                     {
1255                      "$ GLib.Type this_type" : "typeof(Lsp.DocumentSymbol)",
1256                      "$ xns" : "Gtk",
1257                      "* prop" : "expression",
1258                      "string property_name" : "sort_key",
1259                      "xtype" : "PropertyExpression"
1260                     }
1261                    ],
1262                    "xtype" : "StringSorter"
1263                   }
1264                  ],
1265                  "xtype" : "TreeListRowSorter"
1266                 }
1267                ],
1268                "xtype" : "SortListModel",
1269                "| Lsp.DocumentSymbol? getSymbolAt" : [
1270                 "(uint row) {",
1271                 "",
1272                 "   var tr = (Gtk.TreeListRow)this.el.get_item(row);",
1273                 "   ",
1274                 "   var a = tr.get_item();;   ",
1275                 "   GLib.debug(\"get_item (2) = %s\", a.get_type().name());",
1276                 "  \t",
1277                 "   ",
1278                 "   return (Lsp.DocumentSymbol)tr.get_item();",
1279                 "\t ",
1280                 "}"
1281                ],
1282                "| int getRowFromSymbol" : [
1283                 "(Lsp.DocumentSymbol sym) {",
1284                 "",
1285                 "\tfor (var i=0;i < this.el.get_n_items(); i++) {",
1286                 "\t\tvar tr = (Gtk.TreeListRow)this.el.get_item(i);",
1287                 "\t   ",
1288                 "\t\tif (sym.equals( (Lsp.DocumentSymbol)tr.get_item())) {",
1289                 "\t\t\treturn i;",
1290                 "\t\t}",
1291                 "\t}",
1292                 "   \treturn -1;",
1293                 "}"
1294                ],
1295                "| void collapseOnLoad" : [
1296                 "() {",
1297                 "\tfor (var i=0;i < this.el.get_n_items(); i++) {",
1298                 "\t\tvar tr = (Gtk.TreeListRow)this.el.get_item(i);",
1299                 "\t\tvar sym =  (Lsp.DocumentSymbol)tr.get_item();",
1300                 "\t\tswitch (sym.kind) {",
1301                 "\t \t\tcase Lsp.SymbolKind.Enum: ",
1302                 "\t \t\t\ttr.expanded = false;",
1303                 "\t \t\t\tbreak;",
1304                 "\t\t\tdefault:",
1305                 "\t\t\t\t//tr.expanded = true;",
1306                 "\t\t\t\tbreak;",
1307                 "\t\t}",
1308                 "\t}",
1309                 " ",
1310                 "\t",
1311                 "",
1312                 "",
1313                 "}"
1314                ]
1315               }
1316              ],
1317              "xtype" : "NoSelection"
1318             },
1319             {
1320              "$ xns" : "Gtk",
1321              "listeners" : {
1322               "pressed" : [
1323                "(n_press, x, y) => {",
1324                "\tstring pos;",
1325                "  \tvar row = _this.navigation.getRowWidgetAt(x,y, out pos );",
1326                "",
1327                "    if (row == null) {",
1328                "\t    GLib.debug(\"no row selected items\");",
1329                "\t    return;",
1330                "    }",
1331                "\tGLib.debug(\"got click on %s\", row.get_type().name());    ",
1332                "    //Lsp.DocumentSymbol",
1333                "    var sym =  row.get_data<Lsp.DocumentSymbol>(\"symbol\");",
1334                "    if (sym == null) {",
1335                "    \treturn;",
1336                "\t}",
1337                "\t/*",
1338                "\t \"range\" : {",
1339                "              \"start\" : {",
1340                "                \"line\" : 1410,",
1341                "                \"character\" : 8",
1342                "              },",
1343                "              \"end\" : {",
1344                "                \"line\" : 1410,",
1345                "                \"character\" : 39",
1346                "              }",
1347                "            },",
1348                "        */",
1349                "     GLib.debug(\"goto line %d\",   (int)sym.range.start.line); ",
1350                "    _this.scroll_to_line((int)sym.range.start.line);",
1351                "    Gtk.TextIter iter;",
1352                "    _this.buffer.el.get_iter_at_line_offset(out iter, ",
1353                "    \t(int)sym.range.start.line,",
1354                "    \t(int)sym.range.start.character",
1355                "\t);",
1356                "    _this.buffer.el.place_cursor(iter);",
1357                "\t",
1358                "}"
1359               ]
1360              },
1361              "xtype" : "GestureClick"
1362             }
1363            ],
1364            "string name" : "editor-navigation",
1365            "xtype" : "ColumnView",
1366            "| Gtk.Widget? getRowWidgetAt" : [
1367             "(double x,  double  y, out string pos) {",
1368             "",
1369             "\tpos = \"\";",
1370             "\tvar w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);",
1371             "\t//GLib.debug(\"got widget %s\", w == null ? \"nothing\" : w.get_type().name());",
1372             "\tif (w == null) {",
1373             "\t\treturn null;",
1374             "\t}",
1375             "\t",
1376             "\tvar row= w.get_ancestor(GLib.Type.from_name(\"GtkColumnViewRowWidget\"));",
1377             "\tif (row == null) {",
1378             "\t\treturn null;",
1379             "\t}",
1380             "\t",
1381             "\t//GLib.debug(\"got colview %s\", row == null ? \"nothing\" : row.get_type().name());",
1382             "\t ",
1383             " ",
1384             "\t",
1385             "\t//GLib.debug(\"row number is %d\", rn);",
1386             "\t//GLib.debug(\"click %d, %d\", (int)x, (int)y);",
1387             "\t// above or belw",
1388             "\tGraphene.Rect  bounds;",
1389             "\trow.compute_bounds(this.el, out bounds);",
1390             "\t//GLib.debug(\"click x=%d, y=%d, w=%d, h=%d\", ",
1391             "\t//\t(int)bounds.get_x(), (int)bounds.get_y(),",
1392             "\t//\t(int)bounds.get_width(), (int)bounds.get_height()",
1393             "\t//\t);",
1394             "\tvar ypos = y - bounds.get_y();",
1395             "\t//GLib.debug(\"rel ypos = %d\", (int)ypos);\t",
1396             "\tvar rpos = 100.0 * (ypos / bounds.get_height());",
1397             "\t//GLib.debug(\"rel pos = %d %%\", (int)rpos);",
1398             "\tpos = \"over\";",
1399             "\t",
1400             "\tif (rpos > 80) {",
1401             "\t\tpos = \"below\";",
1402             "\t} else if (rpos < 20) {",
1403             "\t\tpos = \"above\";",
1404             "\t} ",
1405             "\treturn row;",
1406             " }"
1407            ],
1408            "| int getRowAt" : [
1409             "(double x,  double  y, out string pos) {",
1410             "",
1411             "\tpos = \"\";",
1412             "\tvar w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);",
1413             "\t//GLib.debug(\"got widget %s\", w == null ? \"nothing\" : w.get_type().name());",
1414             "\tif (w == null) {",
1415             "\t\treturn -1;",
1416             "\t}",
1417             "\t",
1418             "\tvar row= w.get_ancestor(GLib.Type.from_name(\"GtkColumnViewRowWidget\"));",
1419             "\tif (row == null) {",
1420             "\t\treturn -1;",
1421             "\t}",
1422             "\t",
1423             "\t//GLib.debug(\"got colview %s\", row == null ? \"nothing\" : row.get_type().name());",
1424             "\t ",
1425             "\tvar rn = 0;",
1426             "\tvar cr = row;",
1427             "\t ",
1428             "\twhile (cr.get_prev_sibling() != null) {",
1429             "\t\trn++;",
1430             "\t\tcr = cr.get_prev_sibling();",
1431             "\t}",
1432             "\t",
1433             "\t//GLib.debug(\"row number is %d\", rn);",
1434             "\t//GLib.debug(\"click %d, %d\", (int)x, (int)y);",
1435             "\t// above or belw",
1436             "\tGraphene.Rect  bounds;",
1437             "\trow.compute_bounds(this.el, out bounds);",
1438             "\t//GLib.debug(\"click x=%d, y=%d, w=%d, h=%d\", ",
1439             "\t//\t(int)bounds.get_x(), (int)bounds.get_y(),",
1440             "\t//\t(int)bounds.get_width(), (int)bounds.get_height()",
1441             "\t//\t);",
1442             "\tvar ypos = y - bounds.get_y();",
1443             "\t//GLib.debug(\"rel ypos = %d\", (int)ypos);\t",
1444             "\tvar rpos = 100.0 * (ypos / bounds.get_height());",
1445             "\t//GLib.debug(\"rel pos = %d %%\", (int)rpos);",
1446             "\tpos = \"over\";",
1447             "\t",
1448             "\tif (rpos > 80) {",
1449             "\t\tpos = \"below\";",
1450             "\t} else if (rpos < 20) {",
1451             "\t\tpos = \"above\";",
1452             "\t} ",
1453             "\treturn rn;",
1454             " }"
1455            ],
1456            "| void show" : [
1457             "(Gee.ArrayList<Lsp.DocumentSymbol> syms) {",
1458             "\t_this.navigationwindow.el.show();",
1459             "\t//_this.navliststore.el.remove_all();",
1460             "\t",
1461             "\t",
1462             "\tvar ls  = new GLib.ListStore(typeof(Lsp.DocumentSymbol));",
1463             "\t",
1464             "\tforeach(var sym in syms) {",
1465             "\t\tls.append(sym);",
1466             "\t}",
1467             "\tLsp.DocumentSymbol.copyList(ls, _this.navliststore.el);",
1468             "\t//_this.navliststore.el.append(sym);",
1469             "\tthis.last_selected_line = -1;",
1470             "\tGLib.Idle.add(() => {",
1471             "\t\t_this.navigationsort.collapseOnLoad();",
1472             "\t\tGtk.TextIter iter;",
1473             "\t\t_this.buffer.el.get_iter_at_offset (",
1474             "\t\t\t\tout iter, _this.buffer.el.cursor_position);",
1475             "\t\t",
1476             "\t\tGLib.debug(\"idle update scroll %d, %d\", iter.get_line(),",
1477             "\t\t\t\titer.get_line_offset());",
1478             "\t\tthis.updateSelectedLine(",
1479             "\t\t\t\t(uint)iter.get_line(),",
1480             "\t\t\t\t(uint)iter.get_line_offset()",
1481             "\t\t);",
1482             "\t\treturn false;",
1483             "\t});",
1484             "",
1485             "}"
1486            ],
1487            "| void updateSelectedLine" : [
1488             "(uint line, uint chr) {",
1489             "\tif (line == this.last_selected_line) {",
1490             "\t\treturn;",
1491             "\t}",
1492             "\tGLib.debug(\"select line %d\", (int)line);",
1493             "\tthis.last_selected_line = (int)line;",
1494             "\t",
1495             "\t",
1496             "\tvar new_row = -1;",
1497             "\tvar sym = _this.navliststore.symbolAtLine(line, chr);",
1498             "\tif (sym != null) {",
1499             "\t \tnew_row = _this.navigationsort.getRowFromSymbol(sym);",
1500             " \t\tGLib.debug(\"select line %d - row found %d\", (int)line, new_row);",
1501             " \t} else {",
1502             " \t\tGLib.debug(\" no symbol found at line %d\", (int)line);",
1503             " \t}",
1504             " \t",
1505             "\tif (this.selected_row != null) { ",
1506             "\t\tGLib.debug(\" remove selected row\");",
1507             "\t\tthis.selected_row.remove_css_class(\"selected-row\");",
1508             "\t}",
1509             "\tthis.selected_row  = null;",
1510             "\tif (new_row > -1) {",
1511             "\t\tthis.el.scroll_to(new_row,null,Gtk.ListScrollFlags.NONE, null);",
1512             "\t\tvar row = sym.get_data<Gtk.Widget>(\"widget\");",
1513             "\t\tif (row != null) {",
1514             "\t\t\tGLib.debug(\" Add selected row\");",
1515             " \t\t\t",
1516             "\t\t\trow.add_css_class(\"selected-row\");",
1517             "\t\t\tthis.selected_row = row;",
1518             "",
1519             "\t\t\t",
1520             "\t\t} else {",
1521             "\t\t\tGLib.debug(\"could not find widget on row %d\", new_row);",
1522             "\t\t}",
1523             "",
1524             "\t}",
1525             "",
1526             "",
1527             "}"
1528            ]
1529           }
1530          ],
1531          "xtype" : "ScrolledWindow"
1532         }
1533        ],
1534        "xtype" : "Box"
1535       }
1536      ],
1537      "xtype" : "Paned"
1538     }
1539    ],
1540    "xtype" : "Box",
1541    "| bool saveContents" : [
1542     "  ()  {",
1543     "    ",
1544     "    ",
1545     "    if (_this.file == null) {",
1546     "        return true;",
1547     "    }",
1548     "    ",
1549     "     ",
1550     "     ",
1551     "     var str = _this.buffer.toString();",
1552     "     ",
1553     "     _this.buffer.checkSyntax();",
1554     "     ",
1555     "     ",
1556     "     ",
1557     "     // LeftPanel.model.changed(  str , false);",
1558     "     _this.dirty = false;",
1559     "     _this.save_button.el.sensitive = false;",
1560     "     ",
1561     "    // find the text for the node..",
1562     "    if (_this.file.xtype != \"PlainFile\") {",
1563     "       // in theory these properties have to exist!?!",
1564     "    \tthis.prop.val = str;",
1565     "        //this.window.windowstate.left_props.reload();",
1566     "    } else {",
1567     "        _this.file.setSource(  str );",
1568     "     }",
1569     "    ",
1570     "    // call the signal..",
1571     "    this.save();",
1572     "    ",
1573     "    return true;",
1574     "",
1575     "} "
1576    ],
1577    "| int search" : [
1578     "(string in_txt) {",
1579     "",
1580     "\tvar s = new GtkSource.SearchSettings();",
1581     "\ts.case_sensitive = _this.case_sensitive.el.active;",
1582     "\ts.regex_enabled = _this.regex.el.active;\t",
1583     "\ts.wrap_around = false;",
1584     "\t",
1585     "\tthis.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);",
1586     "\tthis.searchcontext.set_highlight(true);",
1587     "\tvar txt = in_txt;",
1588     "\t",
1589     "\tif (_this.multiline.el.active) {",
1590     "\t\ttxt = in_txt.replace(\"\\\\n\", \"\\n\");",
1591     "\t}",
1592     "\t",
1593     "\ts.set_search_text(txt);",
1594     "\tGtk.TextIter beg, st,en;",
1595     "\t ",
1596     "\tthis.buffer.el.get_start_iter(out beg);",
1597     "\tbool has_wrapped_around;",
1598     "\tthis.searchcontext.forward(beg, out st, out en, out has_wrapped_around);",
1599     "\tthis.last_search_end = 0;",
1600     "\t",
1601     "\treturn this.searchcontext.get_occurrences_count();",
1602     "",
1603     " ",
1604     "   ",
1605     "",
1606     "}",
1607     ""
1608    ],
1609    "| string tempFileContents" : [
1610     "() {",
1611     "   ",
1612     "   ",
1613     "   if (_this.file == null) {",
1614     "       return \"\";",
1615     "   }",
1616     "\tvar str= this.buffer.toString();",
1617     "\tif (_this.file.xtype == \"PlainFile\") {",
1618     "    ",
1619     "     \treturn str;",
1620     "    ",
1621     "    }",
1622     "  ",
1623     "      ",
1624     "     ",
1625     "    GLib.debug(\"calling validate\");    ",
1626     "    // clear the buttons.",
1627     " \tif (_this.prop.name == \"xns\" || _this.prop.name == \"xtype\") {",
1628     "\t\treturn this.file.toSource(); ;",
1629     "\t}",
1630     "\t",
1631     "\tvar oldcode  = _this.prop.val;",
1632     "\t_this.prop.val = str;",
1633     "    var ret = _this.file.toSource();",
1634     "    _this.prop.val = oldcode;",
1635     "    return ret;",
1636     "    ",
1637     "}"
1638    ],
1639    "| void backSearch" : [
1640     "(bool change_focus) {",
1641     "",
1642     "\tif (this.searchcontext == null) {",
1643     "\t\treturn;",
1644     "\t}",
1645     "\t",
1646     "\tGtk.TextIter beg, st,en;",
1647     "\tbool has_wrapped_around;",
1648     "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );",
1649     "\t",
1650     "\tif (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {",
1651     "\t\tthis.last_search_end = 0;",
1652     "\t} else {",
1653     "\t\tthis.last_search_end = en.get_offset();",
1654     "\t\tif (change_focus) {",
1655     "\t\t\tthis.view.el.grab_focus();",
1656     "\t\t}",
1657     "\t\tthis.buffer.el.place_cursor(st);",
1658     "\t\tthis.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);",
1659     "\t}",
1660     "",
1661     "}",
1662     ""
1663    ],
1664    "| void forwardSearch" : [
1665     "(bool change_focus) {",
1666     "",
1667     "\tif (this.searchcontext == null) {",
1668     "\t\treturn;",
1669     "\t} ",
1670     "",
1671     "\tGtk.TextIter beg, st,en;",
1672     "\t bool has_wrapped_around;",
1673     "\tthis.buffer.el.get_iter_at_offset(out beg, this.last_search_end);",
1674     "\tif (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {",
1675     "\t",
1676     "\t\tthis.last_search_end = 0; // not sure if this should happen",
1677     "\t} else {",
1678     "\t\tif (has_wrapped_around) {",
1679     "\t\t\treturn;",
1680     "\t\t}",
1681     "\t",
1682     "\t\tthis.last_search_end = en.get_offset();",
1683     "\t\tif (change_focus) {",
1684     "\t\t\tthis.view.el.grab_focus();",
1685     "\t\t}",
1686     "\t\tthis.buffer.el.place_cursor(st);",
1687     "\t\tthis.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);",
1688     "\t}",
1689     " ",
1690     "}",
1691     ""
1692    ],
1693    "| void reset" : [
1694     "() {",
1695     "\t this.file = null;    ",
1696     "     ",
1697     "    this.node = null;",
1698     "    this.prop = null;",
1699     "\tthis.searchcontext = null;",
1700     "  ",
1701     "}",
1702     ""
1703    ],
1704    "| void scroll_to_line" : [
1705     "(int line) {",
1706     "",
1707     "\tGLib.Timeout.add(500, () => {",
1708     "   ",
1709     "\t\tvar buf = this.view.el.get_buffer();",
1710     "",
1711     "\t\tvar sbuf = (GtkSource.Buffer) buf;",
1712     "",
1713     "",
1714     "\t\tGtk.TextIter iter;   ",
1715     "\t\tsbuf.get_iter_at_line(out iter,  line);",
1716     "\t\tthis.view.el.scroll_to_iter(iter,  0.1f, true, 0.0f, 0.5f);",
1717     "\t\treturn false;",
1718     "\t});   ",
1719     "}",
1720     ""
1721    ],
1722    "| void show" : [
1723     "(JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)",
1724     "{",
1725     "    this.reset();",
1726     "    if (this.file != null) {",
1727     "    \tthis.file.navigation_tree_updated.disconnect(",
1728     "    \t\t_this.navigation.show",
1729     "    \t);",
1730     "    }",
1731     "    this.file = file;    ",
1732     "    this.file.navigation_tree_updated.connect(",
1733     "\t\t_this.navigation.show",
1734     "\t);",
1735     "    if (file.xtype != \"PlainFile\") {",
1736     "    \tthis.prop = prop;",
1737     "        this.node = node;",
1738     "",
1739     "        // find the text for the node..",
1740     "        this.view.load( prop.val );",
1741     "        this.updateErrorMarks();",
1742     "        ",
1743     "        ",
1744     "        ",
1745     "        this.close_btn.el.show();       ",
1746     "    ",
1747     "    } else {",
1748     "        this.view.load(        file.toSource() );",
1749     "        this.updateErrorMarks();",
1750     "        this.close_btn.el.hide();",
1751     "        var ls = file.getLanguageServer();",
1752     "        ls.queueDocumentSymbols(file);",
1753     "        ////ls.documentSymbols.begin(file, (a,o) => {",
1754     "        //\t_this.navigation.show(ls.documentSymbols.end(o)); ",
1755     "       //});",
1756     "        //documentSymbols",
1757     "        ",
1758     "    }",
1759     " ",
1760     "}"
1761    ],
1762    "| void updateErrorMarks" : [
1763     "() {",
1764     "\t",
1765     " ",
1766     "",
1767     "\tvar buf = _this.buffer.el;",
1768     "\tGtk.TextIter start;",
1769     "\tGtk.TextIter end;     ",
1770     "\tbuf.get_bounds (out start, out end);",
1771     "",
1772     "\t",
1773     "",
1774     " ",
1775     "\t//GLib.debug(\"highlight errors\");\t\t ",
1776     "",
1777     "\t // we should highlight other types of errors..",
1778     "",
1779     "\tif (_this.window.windowstate.state != WindowState.State.CODEONLY ",
1780     "\t\t&&",
1781     "\t\t_this.window.windowstate.state != WindowState.State.CODE",
1782     "\t\t) {",
1783     "\t\t//GLib.debug(\"windowstate != CODEONLY?\");",
1784     "\t\t",
1785     "\t\treturn;",
1786     "\t} ",
1787     "",
1788     "\t ",
1789     "\tif (_this.file == null) {",
1790     "\t\tGLib.debug(\"file is null?\");",
1791     "\t\treturn;",
1792     "",
1793     "\t}",
1794     "\tvar ar = this.file.getErrors();",
1795     "\tif (ar.size < 1) {",
1796     "\t\tbuf.remove_source_marks (start, end, \"ERR\");",
1797     "\t\tbuf.remove_source_marks (start, end, \"WARN\");",
1798     "\t\tbuf.remove_source_marks (start, end, \"DEPR\");",
1799     "\t\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1800     "\t\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1801     "\t\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1802     "\t\tthis.last_error_counter = file.error_counter ;",
1803     "\t\t//GLib.debug(\"highlight %s :  %s has no errors\", this.file.relpath, category);",
1804     "\t\treturn;",
1805     "\t}",
1806     "\t",
1807     "",
1808     " // basicaly check if there is no change, then we do not do any update..",
1809     " // we can do this by just using an error counter?",
1810     " // if that's changed then we will do an update, otherwise dont bother.",
1811     "\t  ",
1812     "\t",
1813     "\tvar offset = 0;",
1814     "\tvar hoffset = 0;",
1815     "",
1816     "\tvar tlines = buf.get_line_count () +1;",
1817     "\t",
1818     "\tif (_this.prop != null) {",
1819     "\t\t// this still seems flaky...",
1820     "",
1821     "\t\ttlines = _this.prop.end_line;",
1822     "\t\toffset = _this.prop.start_line;",
1823     "\t\thoffset = _this.node.node_pad.length + 2; //shift it left  by 2 ? ..",
1824     "\t\t",
1825     "\t\t ",
1826     "\t} else {",
1827     "\t\t// no update...",
1828     "\t\tif (this.last_error_counter == file.error_counter) {",
1829     "\t\t",
1830     "\t\t\treturn;",
1831     "\t\t}",
1832     "\t",
1833     "\t}",
1834     "\tbuf.remove_source_marks (start, end, \"ERR\");",
1835     "\tbuf.remove_source_marks (start, end, \"WARN\");",
1836     "\tbuf.remove_source_marks (start, end, \"DEPR\");",
1837     "\tbuf.remove_tag_by_name (\"ERR\", start, end);",
1838     "\tbuf.remove_tag_by_name (\"WARN\", start, end);",
1839     "\tbuf.remove_tag_by_name (\"DEPR\", start, end);",
1840     "\t",
1841     "\tforeach(var diag in ar) { ",
1842     "\t     Gtk.TextIter iter;",
1843     "//        print(\"get inter\\n\");",
1844     "\t    var eline = (int)diag.range.start.line - offset;",
1845     "\t    var eline_to = (int)diag.range.end.line - offset;",
1846     "\t    //var eline =  diag.range.end_line - offset;",
1847     "\t    //GLib.debug(\"GOT ERROR on line %d -- converted to %d  (offset = %d)\",",
1848     "\t    //\terr.line ,eline, offset);",
1849     "\t    ",
1850     "\t    ",
1851     "\t    if (eline > tlines || eline < 0) {",
1852     "\t        continue;",
1853     "\t    }",
1854     "\t    ",
1855     "\t    buf.get_iter_at_line( out iter, eline);",
1856     "\t   \tvar msg = \"Line: %d %s : %s\".printf(eline+1, diag.category, diag.message);",
1857     "\t    buf.create_source_mark( msg, diag.category, iter);",
1858     "\t    ",
1859     " \t    var spos = (int)diag.range.start.character - hoffset;",
1860     " \t    if (spos < 0) { spos =0 ; }",
1861     " \t    if (spos > iter.get_chars_in_line()) {",
1862     " \t    \tspos = iter.get_chars_in_line();",
1863     "    \t}",
1864     "\t\tbuf.get_iter_at_line( out iter, eline_to);",
1865     "\t\tvar epos = (int)diag.range.end.character - hoffset;",
1866     " \t    if (epos < 0) { epos =0 ; }",
1867     " \t    if (epos > iter.get_chars_in_line()) {",
1868     " \t    \tepos = iter.get_chars_in_line();",
1869     "    \t}",
1870     " \t     ",
1871     " \t    ",
1872     " \t    buf.get_iter_at_line_offset( out start, eline, spos); ",
1873     " \t   ",
1874     " \t    buf.get_iter_at_line_offset( out end, eline_to,epos); ",
1875     " \t    \t",
1876     "\t    buf.apply_tag_by_name(diag.category, start, end);",
1877     "\t    ",
1878     "\t   // GLib.debug(\"set line %d to %s\", eline, msg);",
1879     "\t    //this.marks.set(eline, msg);",
1880     "\t}",
1881     "\tthis.last_error_counter = file.error_counter ;",
1882     "",
1883     "",
1884     "",
1885     " ",
1886     "",
1887     "}"
1888    ]
1889   }
1890  ],
1891  "name" : "Editor"
1892 }