3 public class Editor : Object
8 public static Editor singleton()
10 if (_Editor == null) {
11 _Editor= new Editor();
15 public Xcls_save_button save_button;
16 public Xcls_close_btn close_btn;
17 public Xcls_RightEditor RightEditor;
18 public Xcls_view view;
19 public Xcls_buffer buffer;
20 public Xcls_keystate keystate;
21 public Xcls_search_entry search_entry;
22 public Xcls_search_results search_results;
23 public Xcls_nextBtn nextBtn;
24 public Xcls_backBtn backBtn;
25 public Xcls_search_settings search_settings;
26 public Xcls_case_sensitive case_sensitive;
27 public Xcls_regex regex;
28 public Xcls_multiline multiline;
29 public Xcls_navigationwindow navigationwindow;
30 public Xcls_navigation navigation;
31 public Xcls_navigationselmodel navigationselmodel;
32 public Xcls_navigationsort navigationsort;
33 public Xcls_navliststore navliststore;
36 public int pos_root_x;
37 public Xcls_MainWindow window;
39 public int pos_root_y;
41 public int last_error_counter;
42 public GtkSource.SearchContext searchcontext;
43 public int last_search_end;
44 public signal void save ();
45 public JsRender.JsRender? file;
46 public JsRender.Node node;
47 public JsRender.NodeProp? prop;
48 public string activeEditor;
54 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
60 this.last_error_counter = 0;
61 this.searchcontext = null;
62 this.last_search_end = 0;
66 this.activeEditor = "\"\"";
69 this.el.homogeneous = false;
70 this.el.hexpand = true;
71 this.el.vexpand = true;
72 var child_1 = new Xcls_Paned1( _this );
74 this.el.append( child_1.el );
77 // user defined functions
78 public bool saveContents () {
81 if (_this.file == null) {
87 var str = _this.buffer.toString();
89 _this.buffer.checkSyntax();
93 // LeftPanel.model.changed( str , false);
95 _this.save_button.el.sensitive = false;
97 // find the text for the node..
98 if (_this.file.xtype != "PlainFile") {
99 // in theory these properties have to exist!?!
101 //this.window.windowstate.left_props.reload();
103 _this.file.setSource( str );
112 public void forwardSearch (bool change_focus) {
114 if (this.searchcontext == null) {
118 Gtk.TextIter beg, st,en;
119 bool has_wrapped_around;
120 this.buffer.el.get_iter_at_offset(out beg, this.last_search_end);
121 if (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {
123 this.last_search_end = 0; // not sure if this should happen
125 if (has_wrapped_around) {
129 this.last_search_end = en.get_offset();
131 this.view.el.grab_focus();
133 this.buffer.el.place_cursor(st);
134 this.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);
138 public void show (JsRender.JsRender file, JsRender.Node? node, JsRender.NodeProp? prop)
141 if (this.file != null) {
142 this.file.navigation_tree_updated.disconnect(
143 _this.navigation.show
147 this.file.navigation_tree_updated.connect(
148 _this.navigation.show
150 if (file.xtype != "PlainFile") {
154 // find the text for the node..
155 this.view.load( prop.val );
156 this.updateErrorMarks();
160 this.close_btn.el.show();
163 this.view.load( file.toSource() );
164 this.updateErrorMarks();
165 this.close_btn.el.hide();
166 var ls = file.getLanguageServer();
167 ls.queueDocumentSymbols(file);
168 ////ls.documentSymbols.begin(file, (a,o) => {
169 // _this.navigation.show(ls.documentSymbols.end(o));
176 public void backSearch (bool change_focus) {
178 if (this.searchcontext == null) {
182 Gtk.TextIter beg, st,en;
183 bool has_wrapped_around;
184 this.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );
186 if (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {
187 this.last_search_end = 0;
189 this.last_search_end = en.get_offset();
191 this.view.el.grab_focus();
193 this.buffer.el.place_cursor(st);
194 this.view.el.scroll_to_iter(st, 0.1f, true, 0.0f, 0.5f);
198 public string tempFileContents () {
201 if (_this.file == null) {
204 var str= this.buffer.toString();
205 if (_this.file.xtype == "PlainFile") {
213 GLib.debug("calling validate");
214 // clear the buttons.
215 if (_this.prop.name == "xns" || _this.prop.name == "xtype") {
216 return this.file.toSource(); ;
219 var oldcode = _this.prop.val;
220 _this.prop.val = str;
221 var ret = _this.file.toSource();
222 _this.prop.val = oldcode;
226 public void reset () {
231 this.searchcontext = null;
234 public int search (string in_txt) {
236 var s = new GtkSource.SearchSettings();
237 s.case_sensitive = _this.case_sensitive.el.active;
238 s.regex_enabled = _this.regex.el.active;
239 s.wrap_around = false;
241 this.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);
242 this.searchcontext.set_highlight(true);
245 if (_this.multiline.el.active) {
246 txt = in_txt.replace("\\n", "\n");
249 s.set_search_text(txt);
250 Gtk.TextIter beg, st,en;
252 this.buffer.el.get_start_iter(out beg);
253 bool has_wrapped_around;
254 this.searchcontext.forward(beg, out st, out en, out has_wrapped_around);
255 this.last_search_end = 0;
257 return this.searchcontext.get_occurrences_count();
263 public void updateErrorMarks () {
267 var buf = _this.buffer.el;
270 buf.get_bounds (out start, out end);
275 //GLib.debug("highlight errors");
277 // we should highlight other types of errors..
279 if (_this.window.windowstate.state != WindowState.State.CODEONLY
281 _this.window.windowstate.state != WindowState.State.CODE
283 //GLib.debug("windowstate != CODEONLY?");
289 if (_this.file == null) {
290 GLib.debug("file is null?");
294 var ar = this.file.getErrors();
296 buf.remove_source_marks (start, end, "ERR");
297 buf.remove_source_marks (start, end, "WARN");
298 buf.remove_source_marks (start, end, "DEPR");
299 buf.remove_tag_by_name ("ERR", start, end);
300 buf.remove_tag_by_name ("WARN", start, end);
301 buf.remove_tag_by_name ("DEPR", start, end);
302 this.last_error_counter = file.error_counter ;
303 //GLib.debug("highlight %s : %s has no errors", this.file.relpath, category);
308 // basicaly check if there is no change, then we do not do any update..
309 // we can do this by just using an error counter?
310 // if that's changed then we will do an update, otherwise dont bother.
316 var tlines = buf.get_line_count () +1;
318 if (_this.prop != null) {
319 // this still seems flaky...
321 tlines = _this.prop.end_line;
322 offset = _this.prop.start_line;
323 hoffset = _this.node.node_pad.length + 2; //shift it left by 2 ? ..
328 if (this.last_error_counter == file.error_counter) {
334 buf.remove_source_marks (start, end, "ERR");
335 buf.remove_source_marks (start, end, "WARN");
336 buf.remove_source_marks (start, end, "DEPR");
337 buf.remove_tag_by_name ("ERR", start, end);
338 buf.remove_tag_by_name ("WARN", start, end);
339 buf.remove_tag_by_name ("DEPR", start, end);
341 foreach(var diag in ar) {
343 // print("get inter\n");
344 var eline = (int)diag.range.start.line - offset;
345 var eline_to = (int)diag.range.end.line - offset;
346 //var eline = diag.range.end_line - offset;
347 //GLib.debug("GOT ERROR on line %d -- converted to %d (offset = %d)",
348 // err.line ,eline, offset);
351 if (eline > tlines || eline < 0) {
355 buf.get_iter_at_line( out iter, eline);
356 var msg = "Line: %d %s : %s".printf(eline+1, diag.category, diag.message);
357 buf.create_source_mark( msg, diag.category, iter);
359 var spos = (int)diag.range.start.character - hoffset;
360 if (spos < 0) { spos =0 ; }
361 if (spos > iter.get_chars_in_line()) {
362 spos = iter.get_chars_in_line();
364 buf.get_iter_at_line( out iter, eline_to);
365 var epos = (int)diag.range.end.character - hoffset;
366 if (epos < 0) { epos =0 ; }
367 if (epos > iter.get_chars_in_line()) {
368 epos = iter.get_chars_in_line();
372 buf.get_iter_at_line_offset( out start, eline, spos);
374 buf.get_iter_at_line_offset( out end, eline_to,epos);
376 buf.apply_tag_by_name(diag.category, start, end);
378 // GLib.debug("set line %d to %s", eline, msg);
379 //this.marks.set(eline, msg);
381 this.last_error_counter = file.error_counter ;
388 public void scroll_to_line (int line) {
390 GLib.Timeout.add(500, () => {
392 var buf = this.view.el.get_buffer();
394 var sbuf = (GtkSource.Buffer) buf;
398 sbuf.get_iter_at_line(out iter, line);
399 this.view.el.scroll_to_iter(iter, 0.1f, true, 0.0f, 0.5f);
403 public class Xcls_Paned1 : Object
406 private Editor _this;
412 public Xcls_Paned1(Editor _owner )
415 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
419 // set gobject values
420 var child_1 = new Xcls_Box2( _this );
422 this.el.start_child = child_1.el;
423 new Xcls_navigationwindow( _this );
424 this.el.end_child = _this.navigationwindow.el;
427 // user defined functions
429 public class Xcls_Box2 : Object
432 private Editor _this;
438 public Xcls_Box2(Editor _owner )
441 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
445 // set gobject values
446 var child_1 = new Xcls_Box3( _this );
448 this.el.append( child_1.el );
449 new Xcls_RightEditor( _this );
450 this.el.append( _this.RightEditor.el );
451 var child_3 = new Xcls_Box15( _this );
453 this.el.append ( child_3.el );
456 // user defined functions
458 public class Xcls_Box3 : Object
461 private Editor _this;
467 public Xcls_Box3(Editor _owner )
470 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
474 // set gobject values
475 this.el.homogeneous = false;
476 this.el.hexpand = true;
477 new Xcls_save_button( _this );
478 this.el.append( _this.save_button.el );
479 var child_2 = new Xcls_Label5( _this );
481 this.el.append( child_2.el );
482 var child_3 = new Xcls_Scale6( _this );
484 this.el.append( child_3.el );
485 new Xcls_close_btn( _this );
486 this.el.append( _this.close_btn.el );
489 // user defined functions
491 public class Xcls_save_button : Object
493 public Gtk.Button el;
494 private Editor _this;
500 public Xcls_save_button(Editor _owner )
503 _this.save_button = this;
504 this.el = new Gtk.Button();
508 // set gobject values
509 this.el.label = "Save";
512 this.el.clicked.connect( () => {
513 _this.saveContents();
517 // user defined functions
520 public class Xcls_Label5 : Object
523 private Editor _this;
529 public Xcls_Label5(Editor _owner )
532 this.el = new Gtk.Label( null );
536 // set gobject values
537 this.el.hexpand = true;
540 // user defined functions
543 public class Xcls_Scale6 : Object
546 private Editor _this;
552 public Xcls_Scale6(Editor _owner )
555 this.el = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL,6, 30, 1);
559 // set gobject values
560 this.el.width_request = 200;
561 this.el.has_origin = true;
562 this.el.draw_value = false;
564 this.el.sensitive = true;
569 //this.el.set_range(6,30);
570 this.el.set_value ( BuilderApplication.settings.editor_font_size);
571 BuilderApplication.settings.editor_font_size_updated.connect(
573 BuilderApplication.settings.editor_font_size_inchange = true;
574 // GLib.debug("update range");
575 this.el.set_value (BuilderApplication.settings.editor_font_size);
576 BuilderApplication.settings.editor_font_size_inchange = false;
584 this.el.change_value.connect( (st, val ) => {
585 if (BuilderApplication.settings.editor_font_size_inchange) {
588 BuilderApplication.settings.editor_font_size = val;
593 // user defined functions
596 public class Xcls_close_btn : Object
598 public Gtk.Button el;
599 private Editor _this;
605 public Xcls_close_btn(Editor _owner )
608 _this.close_btn = this;
609 this.el = new Gtk.Button();
613 // set gobject values
614 this.el.icon_name = "window-close";
615 var child_1 = new Xcls_Image8( _this );
617 this.el.child = child_1.el;
620 this.el.clicked.connect( () => {
621 _this.saveContents();
622 _this.window.windowstate.switchState(WindowState.State.PREVIEW);
626 // user defined functions
628 public class Xcls_Image8 : Object
631 private Editor _this;
637 public Xcls_Image8(Editor _owner )
640 this.el = new Gtk.Image();
644 // set gobject values
645 this.el.icon_name = "window-close";
646 this.el.icon_size = Gtk.IconSize.NORMAL;
649 // user defined functions
654 public class Xcls_RightEditor : Object
656 public Gtk.ScrolledWindow el;
657 private Editor _this;
663 public Xcls_RightEditor(Editor _owner )
666 _this.RightEditor = this;
667 this.el = new Gtk.ScrolledWindow();
671 // set gobject values
672 this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
673 this.el.vexpand = true;
674 this.el.overlay_scrolling = false;
675 this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
676 new Xcls_view( _this );
677 this.el.child = _this.view.el;
680 // user defined functions
682 public class Xcls_view : Object
684 public GtkSource.View el;
685 private Editor _this;
689 public Gtk.CssProvider css;
692 public Xcls_view(Editor _owner )
696 this.el = new GtkSource.View();
701 // set gobject values
702 this.el.auto_indent = true;
703 this.el.indent_width = 4;
704 this.el.name = "editor-view";
705 this.el.show_line_marks = true;
706 this.el.insert_spaces_instead_of_tabs = true;
707 this.el.show_line_numbers = true;
708 this.el.hexpand = true;
709 this.el.vexpand = true;
710 this.el.has_tooltip = true;
711 this.el.css_classes = { "code-editor" };
712 this.el.tab_width = 4;
713 this.el.highlight_current_line = true;
714 new Xcls_buffer( _this );
715 this.el.buffer = _this.buffer.el;
716 new Xcls_keystate( _this );
717 this.el.add_controller( _this.keystate.el );
718 var child_3 = new Xcls_EventControllerScroll13( _this );
720 this.el.add_controller( child_3.el );
721 var child_4 = new Xcls_GestureClick14( _this );
723 this.el.add_controller( child_4.el );
727 this.el.completion.add_provider(
728 new Palete.CompletionProvider(_this)
731 // hover seems pretty useless.. - ??
732 //var hover = this.el.get_hover();
733 //hover.add_provider(new Palete.HoverProvider(_this));
735 //this.el.completion.unblock_interactive();
736 this.el.completion.select_on_show = true; // select
737 //this.el.completion.remember_info_visibility = true;
740 var attrs = new GtkSource.MarkAttributes();
742 attrs.set_icon_name ( "process-stop");
743 attrs.query_tooltip_text.connect(( mark) => {
744 GLib.debug("tooltip query? %s", mark.name);
745 return strdup( mark.name);
747 attrs.query_tooltip_markup.connect(( mark) => {
748 GLib.debug("tooltip query? %s", mark.name);
749 return strdup( mark.name);
751 this.el.set_mark_attributes ("ERR", attrs, 1);
755 var wattrs = new GtkSource.MarkAttributes();
756 wattrs.set_icon_name ( "process-stop");
757 wattrs.query_tooltip_text.connect(( mark) => {
758 GLib.debug("tooltip query? %s", mark.name);
759 return strdup(mark.name);
761 wattrs.query_tooltip_markup.connect(( mark) => {
762 GLib.debug("tooltip query? %s", mark.name);
763 return strdup(mark.name);
765 this.el.set_mark_attributes ("WARN", wattrs, 1);
769 var dattrs = new GtkSource.MarkAttributes();
771 dattrs.set_icon_name ( "process-stop");
773 dattrs.query_tooltip_text.connect(( mark) => {
774 GLib.debug("tooltip query? %s", mark.name);
775 return strdup(mark.name);
777 //dattrs.query_tooltip_markup.connect(( mark) => {
778 // GLib.debug("tooltip query? %s", mark.name);
779 // return strdup(mark.name);
781 this.el.set_mark_attributes ("DEPR", dattrs, 1);
784 this.el.get_space_drawer().set_matrix(null);
785 this.el.get_space_drawer().set_types_for_locations(
786 GtkSource.SpaceLocationFlags.ALL,
787 GtkSource.SpaceTypeFlags.ALL
789 this.el.get_space_drawer().set_enable_matrix(true);
792 this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
794 //GLib.debug("query tooltip");
798 var yoff = (int) _this.RightEditor.el.vadjustment.value;
800 // I think this is problematic - if it's compliing / updating at same time as query.
802 //if (_this.window.statusbar_compile_spinner.el.spinning) {
806 this.el.get_iter_at_position (out iter, out trailing, x, y + yoff);
808 var l = iter.get_line();
812 // GLib.debug("query tooltip line %d", (int) l);
818 if (_this.buffer.marks != null && _this.buffer.marks.has_key(l)) {
819 GLib.debug("line %d setting tip to %s", l, _this.buffer.marks.get(l));
820 tooltip.set_text(_this.buffer.marks.get(l).dup());
828 // this crashes?? - not sure why.
829 var marks = _this.buffer.el.get_source_marks_at_line(l, "ERR");
830 if (marks.is_empty()) {
831 marks = _this.buffer.el.get_source_marks_at_line(l, "WARN");
833 if (marks.is_empty()) {
834 marks = _this.buffer.el.get_source_marks_at_line(l, "DEPR");
837 // GLib.debug("query tooltip line %d marks %d", (int)l, (int) marks.length());
839 marks.@foreach((m) => {
840 //GLib.debug("got mark %s", m.name);
841 str += (str.length > 0 ? "\n" : "") + m.category + ": " + m.name;
843 // true if there is a mark..
844 if (str.length > 0 ) {
845 tooltip.set_text( str );
847 return str.length > 0 ? true : false;
852 // user defined functions
853 public void load (string str) {
855 // show the help page for the active node..
856 //this.get('/Help').show();
858 // this.get('/BottomPane').el.set_current_page(0);
859 GLib.debug("load called - Reset undo buffer");
861 var buf = (GtkSource.Buffer)this.el.get_buffer();
862 buf.begin_irreversible_action();
863 buf.set_text(str, str.length);
864 buf.end_irreversible_action();
866 var lm = GtkSource.LanguageManager.get_default();
868 if (_this.file != null) {
869 lang = _this.file.language;
871 print("lang=%s, content_type = %s\n", lang, _this.file.content_type);
872 var lg = _this.file.content_type.length > 0 ?
873 lm.guess_language(_this.file.path, _this.file.content_type) :
874 lm.get_language(lang);
877 ((GtkSource.Buffer)(this.el.get_buffer())) .set_language(lg);
879 this.el.insert_spaces_instead_of_tabs = true;
881 print("sourcelanguage = %s\n", lg.name);
882 if (lg.name == "Vala") {
883 this.el.insert_spaces_instead_of_tabs = false;
887 this.el.grab_focus();
888 _this.save_button.el.sensitive = false;
889 _this.last_error_counter = -1;
892 public class Xcls_buffer : Object
894 public GtkSource.Buffer el;
895 private Editor _this;
899 public int error_line;
900 public Gee.HashMap<int,string>? xmarks;
901 public bool check_queued;
904 public Xcls_buffer(Editor _owner )
908 this.el = new GtkSource.Buffer( null );
911 this.error_line = -1;
913 this.check_queued = false;
915 // set gobject values
916 this.el.highlight_syntax = true;
917 this.el.highlight_matching_brackets = true;
918 this.el.enable_undo = true;
923 buf.create_tag ("bold", "weight", Pango.Weight.BOLD);
924 buf.create_tag ("type", "weight", Pango.Weight.BOLD, "foreground", "#204a87");
925 buf.create_tag ("keyword", "weight", Pango.Weight.BOLD, "foreground", "#a40000");
926 buf.create_tag ("text", "weight", Pango.Weight.NORMAL, "foreground", "#729fcf");
927 buf.create_tag ("number", "weight", Pango.Weight.BOLD, "foreground", "#ad7fa8");
928 buf.create_tag ("method", "weight", Pango.Weight.BOLD, "foreground", "#729fcf");
929 buf.create_tag ("property", "weight", Pango.Weight.BOLD, "foreground", "#BC1F51");
930 buf.create_tag ("variable", "weight", Pango.Weight.BOLD, "foreground", "#A518B5");
933 buf.create_tag ("ERR", "weight", Pango.Weight.BOLD, "background", "pink");
934 buf.create_tag ("WARN", "weight", Pango.Weight.BOLD, "background", "#ABF4EB");
935 buf.create_tag ("DEPR", "weight", Pango.Weight.BOLD, "background", "#EEA9FF");
938 this.el.cursor_moved.connect( ( ) => {
941 this.el.get_iter_at_offset (
942 out iter, this.el.cursor_position);
943 var line = iter.get_line();
944 _this.navigation.updateSelectedLine(
945 (uint)iter.get_line(),
946 (uint)iter.get_line_offset()
951 this.el.changed.connect( () => {
954 _this.save_button.el.sensitive = true;
955 print("EDITOR CHANGED");
960 // this.get('/LeftPanel.model').changed( str , false);
965 // user defined functions
966 public bool OLDhighlightErrorsJson (string type, Json.Object obj) {
969 this.el.get_bounds (out start, out end);
971 this.el.remove_source_marks (start, end, type);
972 GLib.debug("highlight errors");
974 // we should highlight other types of errors..
976 if (!obj.has_member(type)) {
977 GLib.debug("Return has no errors\n");
981 if (_this.window.windowstate.state != WindowState.State.CODEONLY
983 _this.window.windowstate.state != WindowState.State.CODE
985 GLib.debug("windowstate != CODEONLY?");
990 //this.marks = new Gee.HashMap<int,string>();
991 var err = obj.get_object_member(type);
993 if (_this.file == null) {
994 GLib.debug("file is null?");
998 var valafn = _this.file.path;
1000 if (_this.file.xtype != "PlainFile") {
1004 var regex = new Regex("\\.bjs$");
1005 // should not happen
1006 valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
1007 } catch (GLib.RegexError e) {
1014 if (!err.has_member(valafn)) {
1015 GLib.debug("File path has no errors");
1019 var lines = err.get_object_member(valafn);
1022 if (obj.has_member("line_offset")) { // ?? why??
1023 offset = (int)obj.get_int_member("line_offset") + 1;
1027 var tlines = this.el.get_line_count () +1;
1029 if (_this.prop != null) {
1031 tlines = _this.prop.end_line + 1;
1032 offset = _this.prop.start_line + 1;
1038 lines.foreach_member((obj, line, node) => {
1041 // print("get inter\n");
1042 var eline = int.parse(line) - offset;
1043 GLib.debug("GOT ERROR on line %s -- converted to %d (offset = %d)\n", line,eline, offset);
1046 if (eline > tlines || eline < 0) {
1051 this.el.get_iter_at_line( out iter, eline);
1052 //print("mark line\n");
1054 var ar = lines.get_array_member(line);
1055 for (var i = 0 ; i < ar.get_length(); i++) {
1056 if (ar.get_string_element(i) == "Success") {
1059 msg += (msg.length > 0) ? "\n" : "";
1060 msg += ar.get_string_element(i);
1065 msg = "Line: %d".printf(eline+1) + " " + msg;
1066 this.el.create_source_mark(msg, type, iter);
1067 GLib.debug("set line %d to %m", eline, msg);
1068 // this.marks.set(eline, msg);
1077 public bool checkSyntax () {
1080 var str = this.toString();
1083 if (this.error_line > 0) {
1086 this.el.get_bounds (out start, out end);
1088 this.el.remove_source_marks (start, end, null);
1090 if (str.length < 1) {
1091 print("checkSyntax - empty string?\n");
1096 if (_this.file.xtype == "PlainFile") {
1098 // assume it's gtk...
1099 var oldcode =_this.file.toSource();
1100 _this.file.setSource(str);
1101 BuilderApplication.showSpinner("appointment soon","document change pending");
1102 _this.file.getLanguageServer().document_change(_this.file);
1103 _this.file.getLanguageServer().queueDocumentSymbols(_this.file);
1104 _this.file.setSource(oldcode);
1110 if (_this.file == null) {
1118 GLib.debug("calling validate");
1119 // clear the buttons.
1120 if (_this.prop.name == "xns" || _this.prop.name == "xtype") {
1123 var oldcode = _this.prop.val;
1125 _this.prop.val = str;
1126 _this.node.updated_count++;
1127 _this.file.getLanguageServer().document_change(_this.file);
1128 _this.node.updated_count++;
1129 _this.prop.val = oldcode;
1132 //print("done mark line\n");
1134 return true; // at present allow saving - even if it's invalid..
1136 public bool highlightErrors ( Gee.HashMap<int,string> validate_res) {
1138 this.error_line = validate_res.size;
1140 if (this.error_line < 1) {
1143 var tlines = this.el.get_line_count ();
1145 var valiter = validate_res.map_iterator();
1146 while (valiter.next()) {
1148 // print("get inter\n");
1149 var eline = valiter.get_key();
1150 if (eline > tlines) {
1153 this.el.get_iter_at_line( out iter, eline);
1154 //print("mark line\n");
1155 this.el.create_source_mark(valiter.get_value(), "ERR", iter);
1159 public string toString () {
1163 this.el.get_start_iter(out s);
1164 this.el.get_end_iter(out e);
1165 var ret = this.el.get_text(s,e,true);
1166 //print("TO STRING? " + ret);
1171 public class Xcls_keystate : Object
1173 public Gtk.EventControllerKey el;
1174 private Editor _this;
1178 public bool is_control;
1181 public Xcls_keystate(Editor _owner )
1184 _this.keystate = this;
1185 this.el = new Gtk.EventControllerKey();
1188 this.is_control = false;
1190 // set gobject values
1193 this.el.key_released.connect( (keyval, keycode, state) => {
1195 if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
1196 this.is_control = false;
1198 if (keyval == Gdk.Key.s && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1199 GLib.debug("SAVE: ctrl-S pressed");
1200 _this.saveContents();
1204 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1205 GLib.debug("SAVE: ctrl-g pressed");
1206 _this.forwardSearch(true);
1209 if (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1210 GLib.debug("SAVE: ctrl-f pressed");
1211 _this.search_entry.el.grab_focus();
1212 _this.search_entry.el.select_region(0,-1);
1215 if (keyval == Gdk.Key.space && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1216 _this.view.el.show_completion();
1220 _this.buffer.el.get_iter_at_offset( out iter, _this.buffer.el.cursor_position);
1221 var line = iter.get_line();
1222 var offset = iter.get_line_offset();
1223 GLib.debug("line %d off %d", line ,offset);
1224 if (_this.prop != null) {
1225 line += _this.prop.start_line + 1; // i think..
1226 offset += 12; // should probably be 8 without namespaced
1227 GLib.debug("guess line %d off %d", line ,offset);
1229 //_this.view.el.show_completion();
1230 // print(event.key.keyval)
1237 this.el.key_pressed.connect( (keyval, keycode, state) => {
1239 if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
1240 this.is_control = true;
1246 // user defined functions
1249 public class Xcls_EventControllerScroll13 : Object
1251 public Gtk.EventControllerScroll el;
1252 private Editor _this;
1256 public double distance;
1259 public Xcls_EventControllerScroll13(Editor _owner )
1262 this.el = new Gtk.EventControllerScroll( Gtk.EventControllerScrollFlags.VERTICAL );
1265 this.distance = 0.0f;
1267 // set gobject values
1270 this.el.scroll.connect( (dx, dy) => {
1271 if (!_this.keystate.is_control) {
1274 //GLib.debug("scroll %f", dy);
1276 this.distance += dy;
1278 //GLib.debug("scroll %f / %f", dy, this.distance);
1280 if (this.distance < -1) {
1282 BuilderApplication.settings.editor_font_size ++;
1285 if (this.distance > 1) {
1286 BuilderApplication.settings.editor_font_size --;
1294 // user defined functions
1297 public class Xcls_GestureClick14 : Object
1299 public Gtk.GestureClick el;
1300 private Editor _this;
1306 public Xcls_GestureClick14(Editor _owner )
1309 this.el = new Gtk.GestureClick();
1313 // set gobject values
1316 // user defined functions
1321 public class Xcls_Box15 : Object
1324 private Editor _this;
1330 public Xcls_Box15(Editor _owner )
1333 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1337 // set gobject values
1338 this.el.homogeneous = false;
1339 this.el.vexpand = false;
1340 new Xcls_search_entry( _this );
1341 this.el.append( _this.search_entry.el );
1342 new Xcls_search_results( _this );
1343 this.el.append( _this.search_results.el );
1344 new Xcls_nextBtn( _this );
1345 this.el.append( _this.nextBtn.el );
1346 new Xcls_backBtn( _this );
1347 this.el.append( _this.backBtn.el );
1348 var child_5 = new Xcls_MenuButton21( _this );
1350 this.el.append( child_5.el );
1353 // user defined functions
1355 public class Xcls_search_entry : Object
1357 public Gtk.SearchEntry el;
1358 private Editor _this;
1362 public Gtk.CssProvider css;
1365 public Xcls_search_entry(Editor _owner )
1368 _this.search_entry = this;
1369 this.el = new Gtk.SearchEntry();
1373 // set gobject values
1374 this.el.name = "editor-search-entry";
1375 this.el.hexpand = true;
1376 this.el.placeholder_text = "Press enter to search";
1377 this.el.search_delay = 3;
1378 var child_1 = new Xcls_EventControllerKey17( _this );
1380 this.el.add_controller( child_1.el );
1383 this.el.search_changed.connect( ( ) => {
1385 _this.search(_this.search_entry.el.text);
1386 _this.search_results.updateResults();
1388 GLib.Timeout.add_seconds(1,() => {
1389 _this.search_results.updateResults();
1395 // user defined functions
1396 public void forwardSearch (bool change_focus) {
1399 _this.forwardSearch(change_focus);
1403 switch(_this.windowstate.state) {
1404 case WindowState.State.CODEONLY:
1405 //case WindowState.State.CODE:
1406 // search the code being edited..
1407 _this.windowstate.code_editor_tab.forwardSearch(change_focus);
1410 case WindowState.State.PREVIEW:
1411 if (_this.windowstate.file.xtype == "Gtk") {
1412 _this.windowstate.window_gladeview.forwardSearch(change_focus);
1414 _this.windowstate.window_rooview.forwardSearch(change_focus);
1423 public class Xcls_EventControllerKey17 : Object
1425 public Gtk.EventControllerKey el;
1426 private Editor _this;
1432 public Xcls_EventControllerKey17(Editor _owner )
1435 this.el = new Gtk.EventControllerKey();
1439 // set gobject values
1442 this.el.key_pressed.connect( (keyval, keycode, state) => {
1444 if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
1445 GLib.debug("SAVE: ctrl-g pressed");
1446 _this.forwardSearch(true);
1451 if (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {
1452 _this.forwardSearch(true);
1458 // print(event.key.keyval)
1464 // user defined functions
1468 public class Xcls_search_results : Object
1470 public Gtk.Label el;
1471 private Editor _this;
1477 public Xcls_search_results(Editor _owner )
1480 _this.search_results = this;
1481 this.el = new Gtk.Label( "No Results" );
1485 // set gobject values
1486 this.el.margin_end = 4;
1487 this.el.margin_start = 4;
1490 // user defined functions
1491 public void updateResults () {
1492 this.el.visible = true;
1494 var res = _this.searchcontext.get_occurrences_count();
1496 _this.search_results.el.label = "??? Matches";
1500 _this.nextBtn.el.sensitive = false;
1501 _this.backBtn.el.sensitive = false;
1504 _this.search_results.el.label = "%d Matches".printf(res);
1505 _this.nextBtn.el.sensitive = true;
1506 _this.backBtn.el.sensitive = true;
1509 _this.search_results.el.label = "No Matches";
1514 public class Xcls_nextBtn : Object
1516 public Gtk.Button el;
1517 private Editor _this;
1521 public bool always_show_image;
1524 public Xcls_nextBtn(Editor _owner )
1527 _this.nextBtn = this;
1528 this.el = new Gtk.Button();
1531 this.always_show_image = true;
1533 // set gobject values
1534 this.el.icon_name = "go-down";
1535 this.el.sensitive = false;
1538 this.el.clicked.connect( (event) => {
1540 _this.forwardSearch(true);
1546 // user defined functions
1549 public class Xcls_backBtn : Object
1551 public Gtk.Button el;
1552 private Editor _this;
1556 public bool always_show_image;
1559 public Xcls_backBtn(Editor _owner )
1562 _this.backBtn = this;
1563 this.el = new Gtk.Button();
1566 this.always_show_image = true;
1568 // set gobject values
1569 this.el.icon_name = "go-up";
1570 this.el.sensitive = false;
1573 this.el.clicked.connect( (event) => {
1575 _this.backSearch(true);
1580 // user defined functions
1583 public class Xcls_MenuButton21 : Object
1585 public Gtk.MenuButton el;
1586 private Editor _this;
1590 public bool always_show_image;
1593 public Xcls_MenuButton21(Editor _owner )
1596 this.el = new Gtk.MenuButton();
1599 this.always_show_image = true;
1601 // set gobject values
1602 this.el.icon_name = "emblem-system";
1603 this.el.always_show_arrow = true;
1604 new Xcls_search_settings( _this );
1605 this.el.popover = _this.search_settings.el;
1608 // user defined functions
1610 public class Xcls_search_settings : Object
1612 public Gtk.Popover el;
1613 private Editor _this;
1619 public Xcls_search_settings(Editor _owner )
1622 _this.search_settings = this;
1623 this.el = new Gtk.Popover();
1627 // set gobject values
1628 var child_1 = new Xcls_Box23( _this );
1630 this.el.child = child_1.el;
1633 // user defined functions
1635 public class Xcls_Box23 : Object
1638 private Editor _this;
1644 public Xcls_Box23(Editor _owner )
1647 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1651 // set gobject values
1652 new Xcls_case_sensitive( _this );
1653 this.el.append( _this.case_sensitive.el );
1654 new Xcls_regex( _this );
1655 this.el.append( _this.regex.el );
1656 new Xcls_multiline( _this );
1657 this.el.append( _this.multiline.el );
1660 // user defined functions
1662 public class Xcls_case_sensitive : Object
1664 public Gtk.CheckButton el;
1665 private Editor _this;
1671 public Xcls_case_sensitive(Editor _owner )
1674 _this.case_sensitive = this;
1675 this.el = new Gtk.CheckButton();
1679 // set gobject values
1680 this.el.label = "Case Sensitive";
1689 // user defined functions
1692 public class Xcls_regex : Object
1694 public Gtk.CheckButton el;
1695 private Editor _this;
1701 public Xcls_regex(Editor _owner )
1705 this.el = new Gtk.CheckButton();
1709 // set gobject values
1710 this.el.label = "Regex";
1719 // user defined functions
1722 public class Xcls_multiline : Object
1724 public Gtk.CheckButton el;
1725 private Editor _this;
1731 public Xcls_multiline(Editor _owner )
1734 _this.multiline = this;
1735 this.el = new Gtk.CheckButton();
1739 // set gobject values
1740 this.el.label = "Multi-line (add \\n)";
1743 // user defined functions
1751 public class Xcls_navigationwindow : Object
1753 public Gtk.ScrolledWindow el;
1754 private Editor _this;
1760 public Xcls_navigationwindow(Editor _owner )
1763 _this.navigationwindow = this;
1764 this.el = new Gtk.ScrolledWindow();
1768 // set gobject values
1769 this.el.visible = false;
1770 new Xcls_navigation( _this );
1771 this.el.child = _this.navigation.el;
1774 // user defined functions
1776 public class Xcls_navigation : Object
1778 public Gtk.ColumnView el;
1779 private Editor _this;
1783 public int last_selected_line;
1784 public Gtk.Widget? selected_row;
1787 public Xcls_navigation(Editor _owner )
1790 _this.navigation = this;
1791 new Xcls_navigationselmodel( _this );
1792 this.el = new Gtk.ColumnView( _this.navigationselmodel.el );
1795 this.last_selected_line = -1;
1796 this.selected_row = null;
1798 // set gobject values
1799 this.el.name = "editor-navigation";
1800 var child_2 = new Xcls_ColumnViewColumn29( _this );
1802 this.el.append_column( child_2.el );
1803 var child_3 = new Xcls_GestureClick38( _this );
1805 this.el.add_controller( child_3.el );
1808 // user defined functions
1809 public Gtk.Widget? getRowWidgetAt (double x, double y, out string pos) {
1812 var w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);
1813 //GLib.debug("got widget %s", w == null ? "nothing" : w.get_type().name());
1818 var row= w.get_ancestor(GLib.Type.from_name("GtkColumnViewRowWidget"));
1823 //GLib.debug("got colview %s", row == null ? "nothing" : row.get_type().name());
1827 //GLib.debug("row number is %d", rn);
1828 //GLib.debug("click %d, %d", (int)x, (int)y);
1830 Graphene.Rect bounds;
1831 row.compute_bounds(this.el, out bounds);
1832 //GLib.debug("click x=%d, y=%d, w=%d, h=%d",
1833 // (int)bounds.get_x(), (int)bounds.get_y(),
1834 // (int)bounds.get_width(), (int)bounds.get_height()
1836 var ypos = y - bounds.get_y();
1837 //GLib.debug("rel ypos = %d", (int)ypos);
1838 var rpos = 100.0 * (ypos / bounds.get_height());
1839 //GLib.debug("rel pos = %d %%", (int)rpos);
1844 } else if (rpos < 20) {
1849 public void show (Gee.ArrayList<Lsp.DocumentSymbol> syms) {
1850 _this.navigationwindow.el.show();
1851 _this.navliststore.el.remove_all();
1852 foreach(var sym in syms) {
1853 _this.navliststore.el.append(sym);
1855 this.last_selected_line = -1;
1856 GLib.Idle.add(() => {
1859 _this.buffer.el.get_iter_at_offset (
1860 out iter, _this.buffer.el.cursor_position);
1862 GLib.debug("idle update scroll %d, %d", iter.get_line(),
1863 iter.get_line_offset());
1864 this.updateSelectedLine(
1865 (uint)iter.get_line(),
1866 (uint)iter.get_line_offset()
1872 public int getRowAt (double x, double y, out string pos) {
1875 var w = this.el.pick(x, y, Gtk.PickFlags.DEFAULT);
1876 //GLib.debug("got widget %s", w == null ? "nothing" : w.get_type().name());
1881 var row= w.get_ancestor(GLib.Type.from_name("GtkColumnViewRowWidget"));
1886 //GLib.debug("got colview %s", row == null ? "nothing" : row.get_type().name());
1891 while (cr.get_prev_sibling() != null) {
1893 cr = cr.get_prev_sibling();
1896 //GLib.debug("row number is %d", rn);
1897 //GLib.debug("click %d, %d", (int)x, (int)y);
1899 Graphene.Rect bounds;
1900 row.compute_bounds(this.el, out bounds);
1901 //GLib.debug("click x=%d, y=%d, w=%d, h=%d",
1902 // (int)bounds.get_x(), (int)bounds.get_y(),
1903 // (int)bounds.get_width(), (int)bounds.get_height()
1905 var ypos = y - bounds.get_y();
1906 //GLib.debug("rel ypos = %d", (int)ypos);
1907 var rpos = 100.0 * (ypos / bounds.get_height());
1908 //GLib.debug("rel pos = %d %%", (int)rpos);
1913 } else if (rpos < 20) {
1918 public void updateSelectedLine (uint line, uint chr) {
1919 if (line == this.last_selected_line) {
1922 GLib.debug("select line %d", (int)line);
1923 this.last_selected_line = (int)line;
1927 var sym = _this.navliststore.symbolAtLine(line, chr);
1929 new_row = _this.navigationsort.getRowFromSymbol(sym);
1930 GLib.debug("select line %d - row found %d", (int)line, new_row);
1932 GLib.debug(" no symbol found at line %d", (int)line);
1935 if (this.selected_row != null) {
1936 GLib.debug(" remove selected row");
1937 this.selected_row.remove_css_class("selected-row");
1939 this.selected_row = null;
1941 this.el.scroll_to(new_row,null,Gtk.ListScrollFlags.NONE, null);
1942 var row = sym.get_data<Gtk.Widget>("widget");
1944 GLib.debug(" Add selected row");
1946 row.add_css_class("selected-row");
1947 this.selected_row = row;
1951 GLib.debug("could not find widget on row %d", new_row);
1959 public class Xcls_ColumnViewColumn29 : Object
1961 public Gtk.ColumnViewColumn el;
1962 private Editor _this;
1968 public Xcls_ColumnViewColumn29(Editor _owner )
1971 var child_1 = new Xcls_SignalListItemFactory30( _this );
1973 this.el = new Gtk.ColumnViewColumn( "Code Navigation", child_1.el );
1977 // set gobject values
1978 this.el.expand = true;
1981 // user defined functions
1983 public class Xcls_SignalListItemFactory30 : Object
1985 public Gtk.SignalListItemFactory el;
1986 private Editor _this;
1992 public Xcls_SignalListItemFactory30(Editor _owner )
1995 this.el = new Gtk.SignalListItemFactory();
1999 // set gobject values
2002 this.el.setup.connect( (listitem) => {
2004 var expand = new Gtk.TreeExpander();
2006 expand.set_indent_for_depth(true);
2007 expand.set_indent_for_icon(true);
2008 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2009 var icon = new Gtk.Image();
2010 var lbl = new Gtk.Label("");
2011 lbl.use_markup = true;
2012 lbl.ellipsize = Pango.EllipsizeMode.END;
2014 icon.margin_end = 4;
2015 lbl.justify = Gtk.Justification.LEFT;
2018 // listitem.activatable = true; ??
2022 expand.set_child(hbox);
2023 ((Gtk.ListItem)listitem).set_child(expand);
2026 this.el.bind.connect( (listitem) => {
2027 // GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2029 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2030 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2033 var hbox = (Gtk.Box) expand.child;
2036 var img = (Gtk.Image) hbox.get_first_child();
2037 var lbl = (Gtk.Label) img.get_next_sibling();
2039 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2040 var sym = (Lsp.DocumentSymbol) lr.get_item();
2042 sym.set_data<Gtk.Widget>("widget", expand.get_parent());
2043 expand.get_parent().get_parent().set_data<Lsp.DocumentSymbol>("symbol", sym);
2045 GLib.debug("save sym on %s", expand.get_parent().get_parent().get_type().name());
2047 //GLib.debug("got %d children for %s" , (int)sym.children.get_n_items(), sym.name);
2049 expand.set_hide_expander( sym.children.get_n_items() < 1);
2050 expand.set_list_row(lr);
2052 sym.bind_property("symbol_icon",
2054 GLib.BindingFlags.SYNC_CREATE);
2056 hbox.add_css_class(sym.symbol_icon);
2058 sym.bind_property("name",
2060 GLib.BindingFlags.SYNC_CREATE);
2061 // should be better?- --line no?
2062 sym.bind_property("tooltip",
2063 lbl, "tooltip_markup",
2064 GLib.BindingFlags.SYNC_CREATE);
2070 // user defined functions
2074 public class Xcls_navigationselmodel : Object
2076 public Gtk.NoSelection el;
2077 private Editor _this;
2083 public Xcls_navigationselmodel(Editor _owner )
2086 _this.navigationselmodel = this;
2087 new Xcls_navigationsort( _this );
2088 this.el = new Gtk.NoSelection( _this.navigationsort.el );
2092 // set gobject values
2095 // user defined functions
2097 public class Xcls_navigationsort : Object
2099 public Gtk.SortListModel el;
2100 private Editor _this;
2106 public Xcls_navigationsort(Editor _owner )
2109 _this.navigationsort = this;
2110 var child_1 = new Xcls_TreeListModel33( _this );
2112 var child_2 = new Xcls_TreeListRowSorter35( _this );
2114 this.el = new Gtk.SortListModel( child_1.el, child_2.el );
2118 // set gobject values
2121 // user defined functions
2122 public int getRowFromSymbol (Lsp.DocumentSymbol sym) {
2124 for (var i=0;i < this.el.get_n_items(); i++) {
2125 var tr = (Gtk.TreeListRow)this.el.get_item(i);
2127 if (sym.equals( (Lsp.DocumentSymbol)tr.get_item())) {
2133 public Lsp.DocumentSymbol? getSymbolAt (uint row) {
2135 var tr = (Gtk.TreeListRow)this.el.get_item(row);
2137 var a = tr.get_item();;
2138 GLib.debug("get_item (2) = %s", a.get_type().name());
2141 return (Lsp.DocumentSymbol)tr.get_item();
2145 public class Xcls_TreeListModel33 : Object
2147 public Gtk.TreeListModel el;
2148 private Editor _this;
2154 public Xcls_TreeListModel33(Editor _owner )
2157 new Xcls_navliststore( _this );
2158 this.el = new Gtk.TreeListModel( _this.navliststore.el, false, true, (item) => {
2160 return ((Lsp.DocumentSymbol)item).children;
2166 // set gobject values
2169 // user defined functions
2171 public class Xcls_navliststore : Object
2173 public GLib.ListStore el;
2174 private Editor _this;
2180 public Xcls_navliststore(Editor _owner )
2183 _this.navliststore = this;
2184 this.el = new GLib.ListStore( typeof(Lsp.DocumentSymbol) );
2188 // set gobject values
2191 // user defined functions
2192 public Lsp.DocumentSymbol? symbolAtLine (uint line, uint chr) {
2195 for(var i = 0; i < this.el.get_n_items();i++) {
2196 var el = (Lsp.DocumentSymbol)this.el.get_item(i);
2197 //GLib.debug("Check sym %s : %d-%d",
2198 // el.name , (int)el.range.start.line,
2199 // (int)el.range.end.line
2201 var ret = el.containsLine(line,chr);
2213 public class Xcls_TreeListRowSorter35 : Object
2215 public Gtk.TreeListRowSorter el;
2216 private Editor _this;
2222 public Xcls_TreeListRowSorter35(Editor _owner )
2225 var child_1 = new Xcls_StringSorter36( _this );
2227 this.el = new Gtk.TreeListRowSorter( child_1.el );
2231 // set gobject values
2234 // user defined functions
2236 public class Xcls_StringSorter36 : Object
2238 public Gtk.StringSorter el;
2239 private Editor _this;
2245 public Xcls_StringSorter36(Editor _owner )
2248 var child_1 = new Xcls_PropertyExpression37( _this );
2250 this.el = new Gtk.StringSorter( child_1.el );
2254 // set gobject values
2257 // user defined functions
2259 public class Xcls_PropertyExpression37 : Object
2261 public Gtk.PropertyExpression el;
2262 private Editor _this;
2268 public Xcls_PropertyExpression37(Editor _owner )
2271 this.el = new Gtk.PropertyExpression( typeof(Lsp.DocumentSymbol), null, "sort_key" );
2275 // set gobject values
2278 // user defined functions
2285 public class Xcls_GestureClick38 : Object
2287 public Gtk.GestureClick el;
2288 private Editor _this;
2294 public Xcls_GestureClick38(Editor _owner )
2297 this.el = new Gtk.GestureClick();
2301 // set gobject values
2304 this.el.pressed.connect( (n_press, x, y) => {
2306 var row = _this.navigation.getRowWidgetAt(x,y, out pos );
2309 GLib.debug("no row selected items");
2312 GLib.debug("got click on %s", row.get_type().name());
2313 //Lsp.DocumentSymbol
2314 var sym = row.get_data<Lsp.DocumentSymbol>("symbol");
2330 GLib.debug("goto line %d", (int)sym.range.start.line);
2331 _this.scroll_to_line((int)sym.range.start.line);
2333 _this.buffer.el.get_iter_at_line_offset(out iter,
2334 (int)sym.range.start.line,
2335 (int)sym.range.start.character
2337 _this.buffer.el.place_cursor(iter);
2342 // user defined functions