+ "float xalign" : 0,
+ "id" : "helper",
+ "int margin_end" : 4,
+ "int margin_start" : 4,
+ "listeners" : {
+ "query_tooltip" : [
+ "(x, y, keyboard_tooltip, tooltip) => {",
+ "\tGLib.debug(\"using quiery tooltip?\");",
+ "\tvar lbl = new Gtk.Label(this.el.tooltip_markup);",
+ "\tlbl.width_request = 500;",
+ "\ttooltip.set_custom(lbl);",
+ "",
+ "\treturn true;",
+ "}",
+ ""
+ ]
+ },
+ "xtype" : "Label",
+ "| void setHelp" : [
+ "(Lsp.Hover? help) {",
+ "\tif (help == null || help.contents == null",
+ "\t\t|| help.contents.size < 1) {",
+ "\t\tthis.el.set_text(\"\");",
+ "\t\treturn;",
+ "\t}",
+ "\tvar sig = help.contents.get(0).value.split(\" \");",
+ "\tstring[] str = {};",
+ "\tfor(var i =0; i < sig.length; i++) {",
+ "\t",
+ "\t\tswitch(sig[i]) {",
+ "\t\t\tcase \"public\":",
+ "\t\t\tcase \"private\":",
+ "\t\t\tcase \"protected\":",
+ "\t\t\tcase \"async\":",
+ "\t\t\tcase \"class\":",
+ "\t\t\tcase \"{\":",
+ "\t\t\tcase \"}\":",
+ "\t\t\tcase \"(\":",
+ "\t\t\tcase \")\":",
+ "\t\t\t",
+ "\t\t\t\tstr += sig[i];",
+ "\t\t\t\tcontinue;",
+ "\t\t\t\t",
+ "\t\t\t\t",
+ "\t\t\tdefault:",
+ "\t",
+ "\t\t\t\tstr += (\"<span underline=\\\"single\\\" color=\\\"blue\\\" >\" + ",
+ "\t\t\t\t\tGLib.Markup.escape_text(sig[i])",
+ "\t\t\t\t\t+\"</span>\");",
+ "\t\t\tcontinue;",
+ "\t\t}",
+ "\t}",
+ "\tif (help.contents.size > 1) {",
+ "\t\tthis.el.tooltip_markup = GLib.Markup.escape_text(help.contents.get(1).value);",
+ "\t}",
+ "\t",
+ "\tthis.el.set_markup(string.joinv(\" \",str));",
+ "\t",
+ "}"
+ ]