}
// user defined functions
+ public bool highlightErrors ( Gee.HashMap<int,string> validate_res) {
+ this.error_line = validate_res.size;
+
+ if (this.error_line < 1) {
+ return true;
+ }
+ var tlines = this.el.get_line_count ();
+ Gtk.TextIter iter;
+ var valiter = validate_res.map_iterator();
+ while (valiter.next()) {
+
+ // print("get inter\n");
+ var eline = valiter.get_key();
+ if (eline > tlines) {
+ continue;
+ }
+ this.el.get_iter_at_line( out iter, eline);
+ //print("mark line\n");
+ this.el.create_source_mark(valiter.get_value(), "error", iter);
+ }
+ return false;
+ }
public string toString () {
Gtk.TextIter s;
if (_this.file.language == "js") {
- return _this.highlightErrors(p.validateJavascript(
+ this.check_running = false;
+ print("calling validate javascript\n");
+ return this.highlightErrors(p.validateJavascript(
str,
_this.key,
_this.ptype,
}
- print("calling validate code\n");
- p.validateCode.begin(
+ print("calling validate vala\n");
+ p.validateVala.begin(
str,
_this.key,
_this.ptype,
_this.node,
(obj, res) => {
this.check_running = false;
- var validate_res = p.validateCode.end(res);
- this.error_line = validate_res.size;
+ var validate_res = p.validateVala.end(res);
+ this.highlightErrors(validate_res);
- if (this.error_line < 1) {
- return;
- }
- var tlines = this.el.get_line_count ();
- Gtk.TextIter iter;
- var valiter = validate_res.map_iterator();
- while (valiter.next()) {
-
- // print("get inter\n");
- var eline = valiter.get_key();
- if (eline > tlines) {
- continue;
- }
- this.el.get_iter_at_line( out iter, eline);
- //print("mark line\n");
- this.el.create_source_mark(valiter.get_value(), "error", iter);
- }
-
}
);