From 22be1768a48c8284ac63ad046a0038b814fde930 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Sun, 28 Jan 2024 12:52:06 +0800 Subject: [PATCH] src/Lsp.vala --- src/Lsp.vala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Lsp.vala b/src/Lsp.vala index 1e6c4651d..7288f72a2 100644 --- a/src/Lsp.vala +++ b/src/Lsp.vala @@ -137,6 +137,9 @@ 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; + } public int compare_to (Range other) { return start.compare_to (other.start); @@ -158,6 +161,7 @@ namespace Lsp { public bool contains (Position pos) { return start.compare_to (pos) <= 0 && pos.compare_to (end) <= 0; } + } public class Diagnostic : Object { @@ -204,6 +208,10 @@ namespace Lsp { private set {} } + public bool equals(Lsp.Diagnostic o) { + return this.range.equals(o.range) && this.severity == o.severity && this.message == o.message; + + } } /** -- 2.39.2