X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=src%2FLsp.vala;h=6bc7166b418ddeeda9a75c85510675f1ba58d1c6;hb=a4d742169ad9fd255e938cebe2e6fec2c7121979;hp=d13b916342c8f8de09135dc0c5a3a8fde52ea712;hpb=a3bc4d05fe08b2714d5bca8b7539560ab4858f32;p=roobuilder diff --git a/src/Lsp.vala b/src/Lsp.vala index d13b91634..6bc7166b4 100644 --- a/src/Lsp.vala +++ b/src/Lsp.vala @@ -83,7 +83,10 @@ namespace Lsp { (character > other.character ? 1 : (character == other.character ? 0 : -1)) : -1); } - + public bool equals(Position o) { + return o.line == this.line && o.character == this.character; + } + public string to_string () { return @"$line:$character"; } @@ -148,7 +151,7 @@ namespace Lsp { public bool equal_to (Range other) { return this.to_string () == other.to_string (); } public bool equals (Range o) { - return this.filename == o.filename && this.start == o.start && this.end == o.end; + return this.filename == o.filename && this.start.equals(o.start) && this.end.equals(o.end); } public int compare_to (Range other) { @@ -229,7 +232,11 @@ namespace Lsp { } public bool equals(Lsp.Diagnostic o) { - return this.range.equals(o.range) && this.severity == o.severity && this.message == o.message; + var ret = this.range.equals(o.range) && this.severity == o.severity && this.message == o.message; + //GLib.debug("compare %s (%s == %s)", ret ? "YES" : "NO", this.to_string(), o.to_string()); + + + return ret; } public string to_string() {