vala-lang / vala-language-server

Code Intelligence for Vala & Genie
GNU Lesser General Public License v2.1
290 stars 43 forks source link

[patch] Make comoilable on Debian 11 #291

Open gegoxaren opened 1 year ago

gegoxaren commented 1 year ago

Due to Debian 11 having an outdated version of valac, some of the newer syntactic sugar does not work. This patch makes VLS compile-able on Debian 11 again.

=== modified file 'src/protocol.vala'
--- old/src/protocol.vala   2023-03-01 16:14:01 +0000
+++ new/src/protocol.vala   2023-04-30 17:17:17 +0000
@@ -145,10 +145,9 @@
          * Return a new range that includes `this` and `other`.
          */
         public Range union (Range other) {
-            var range = new Range () {
-                start = start.compare_to (other.start) < 0 ? start : other.start,
-                end = end.compare_to (other.end) < 0 ? other.end : end,
-            };
+            var range = new Range ();
+            range.start = start.compare_to (other.start) < 0 ? start : other.start;
+            range.end = end.compare_to (other.end) < 0 ? other.end : end;
             if (filename == other.filename)
                 range.filename = filename;
             return range;

Thank you.

Prince781 commented 1 year ago

A MR would be easier to deal with, if you prefer.

Prince781 commented 1 year ago

We do have Debian 11 packages in the OBS repo: https://software.opensuse.org//download.html?project=home%3APrince781&package=vala-language-server