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