Commit 8d179e29 authored by Sebastien Granjoux's avatar Sebastien Granjoux

bgo #698158: anjuta-3.8.1 fails to build with vala-0.20

Add support for vala 0.20 and remove support for vala 0.16
parent 1761f43d
......@@ -285,10 +285,10 @@ if test "$user_disabled_vala" = 1; then
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if libvala is available)
PKG_CHECK_EXISTS([ libvala-0.18 ],
[ valaver="-0.18" ],
[ PKG_CHECK_EXISTS([ libvala-0.16 ],
[ valaver="-0.16" ],
PKG_CHECK_EXISTS([ libvala-0.20 ],
[ valaver="-0.20" ],
[ PKG_CHECK_EXISTS([ libvala-0.18 ],
[ valaver="-0.18" ],
[ valaver="" ])
])
if test "x$valaver" != "x"; then
......@@ -299,7 +299,7 @@ else
else
AC_MSG_RESULT(no)
enable_vala="no"
VALA_REQUIRED=0.16.0
VALA_REQUIRED=0.18.0
fi
AC_SUBST(LIBVALA)
fi
......
......@@ -25,13 +25,8 @@ public class BlockLocator : Vala.CodeVisitor {
this.column = column;
}
public bool inside (Vala.SourceReference src) {
#if VALA_0_18
var begin = Location (src.begin.line, src.begin.column);
var end = Location (src.end.line, src.end.column);
#else
var begin = Location (src.first_line, src.first_column);
var end = Location (src.last_line, src.last_column);
#endif
return begin.before (this) && this.before(end);
}
......@@ -60,13 +55,8 @@ public class BlockLocator : Vala.CodeVisitor {
if (!location.inside (s.source_reference))
return false;
#if VALA_0_18
var begin = Location (s.source_reference.begin.line, s.source_reference.begin.column);
var end = Location (s.source_reference.end.line, s.source_reference.end.column);
#else
var begin = Location (s.source_reference.first_line, s.source_reference.first_column);
var end = Location (s.source_reference.last_line, s.source_reference.last_column);
#endif
if (innermost == null || (innermost_begin.before(begin) && end.before(innermost_end))) {
innermost = s;
......
......@@ -69,11 +69,7 @@ public class ValaProvider : Object, IAnjuta.Provider {
var proposals = new GLib.List<IAnjuta.EditorAssistProposal?>();
foreach (var symbol in syms) {
if (symbol is Vala.LocalVariable
#if VALA_0_18
&& symbol.source_reference.begin.line > editor.get_lineno())
#else
&& symbol.source_reference.first_line > editor.get_lineno())
#endif
continue;
var prop = IAnjuta.EditorAssistProposal();
......
......@@ -41,30 +41,17 @@ public class AnjutaReport : Vala.Report {
if (e.source.file.filename.has_suffix (((IAnjuta.Document)editor).get_filename ())) {
if (ind != null) {
/* begin_iter should be one cell before to select the first character */
#if VALA_0_18
var begin_iter = editor.get_line_begin_position (e.source.begin.line);
for (var i = 1; i < e.source.begin.column; i++)
begin_iter.next ();
var end_iter = editor.get_line_begin_position (e.source.end.line);
for (var i = 0; i < e.source.end.column; i++)
end_iter.next ();
#else
var begin_iter = editor.get_line_begin_position (e.source.first_line);
for (var i = 1; i < e.source.first_column; i++)
begin_iter.next ();
var end_iter = editor.get_line_begin_position (e.source.last_line);
for (var i = 0; i < e.source.last_column; i++)
end_iter.next ();
#endif
ind.set(begin_iter, end_iter, e.error ? IAnjuta.IndicableIndicator.CRITICAL :
IAnjuta.IndicableIndicator.WARNING);
}
if (editor is IAnjuta.Markable) {
#if VALA_0_18
mark.mark(e.source.begin.line, IAnjuta.MarkableMarker.MESSAGE, e.message);
#else
mark.mark(e.source.first_line, IAnjuta.MarkableMarker.MESSAGE, e.message);
#endif
}
}
......
......@@ -157,11 +157,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_class (Class cl) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = cl.source_reference.begin.line;
#else
entry.line_number = cl.source_reference.first_line;
#endif
entry.name = cl.name;
entry.kind_name = "class";
entry.kind = 'c';
......@@ -176,11 +172,7 @@ public class CTagsVisitor : CodeVisitor {
}
public override void visit_struct (Struct st) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = st.source_reference.begin.line;
#else
entry.line_number = st.source_reference.first_line;
#endif
entry.name = st.name;
entry.kind_name = "struct";
entry.kind = 's';
......@@ -194,11 +186,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_interface (Interface iface) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = iface.source_reference.begin.line;
#else
entry.line_number = iface.source_reference.first_line;
#endif
entry.name = iface.name;
entry.kind_name = "interface";
entry.kind = 'i';
......@@ -214,11 +202,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_enum (Vala.Enum en) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = en.source_reference.begin.line;
#else
entry.line_number = en.source_reference.first_line;
#endif
entry.name = en.name;
entry.kind_name = "enum";
entry.kind = 'e';
......@@ -232,11 +216,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_error_domain (ErrorDomain edomain) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = edomain.source_reference.begin.line;
#else
entry.line_number = edomain.source_reference.first_line;
#endif
entry.name = edomain.name;
entry.kind_name = "errordomain";
entry.kind = 'E';
......@@ -251,11 +231,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_enum_value (Vala.EnumValue ev) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = ev.source_reference.begin.line;
#else
entry.line_number = ev.source_reference.first_line;
#endif
entry.name = ev.name;
entry.kind_name = "enumvalue";
entry.kind = 'v';
......@@ -268,11 +244,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_error_code (ErrorCode ecode) {
var entry = CTagsEntry();
#if VALA_0_18
//entry.line_number = ecode.source_reference.begin.line;
#else
//entry.line_number = ecode.source_reference.first_line;
#endif
entry.name = ecode.name;
entry.kind_name = "errorcode";
entry.kind = 'r';
......@@ -286,11 +258,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_delegate (Delegate d) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = d.source_reference.begin.line;
#else
entry.line_number = d.source_reference.first_line;
#endif
entry.name = d.name;
entry.kind_name = "delegate";
entry.kind = 'd';
......@@ -305,11 +273,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_signal (Vala.Signal sig) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = sig.source_reference.begin.line;
#else
entry.line_number = sig.source_reference.first_line;
#endif
entry.name = sig.name;
entry.kind_name = "signal";
entry.kind = 'S';
......@@ -325,11 +289,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_field (Field f) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = f.source_reference.begin.line;
#else
entry.line_number = f.source_reference.first_line;
#endif
entry.name = f.name;
entry.kind_name = "field";
entry.kind = 'f';
......@@ -343,11 +303,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_constant (Constant c) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = c.source_reference.begin.line;
#else
entry.line_number = c.source_reference.first_line;
#endif
entry.name = c.name;
entry.kind_name = "field";
entry.kind = 'f';
......@@ -361,11 +317,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_property (Property prop) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = prop.source_reference.begin.line;
#else
entry.line_number = prop.source_reference.first_line;
#endif
entry.name = prop.name;
entry.kind_name = "property";
entry.kind = 'p';
......@@ -381,11 +333,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_method (Method m) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = m.source_reference.begin.line;
#else
entry.line_number = m.source_reference.first_line;
#endif
entry.name = m.name;
entry.kind_name = "method";
entry.kind = 'm';
......@@ -402,11 +350,7 @@ public class CTagsVisitor : CodeVisitor {
public override void visit_local_variable (LocalVariable local) {
var entry = CTagsEntry();
#if VALA_0_18
entry.line_number = local.source_reference.begin.line;
#else
entry.line_number = local.source_reference.first_line;
#endif
entry.name = local.name;
entry.kind_name = "local";
entry.kind = 'l';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment