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