[gnome-builder] vala: escape < and > in completion results
- From: Ben Iofel <beniofel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] vala: escape < and > in completion results
- Date: Thu, 24 Mar 2016 07:06:41 +0000 (UTC)
commit aba994e937ec7103c200b25ad83ee295e56359da
Author: Ben Iofel <iofelben gmail com>
Date: Thu Mar 24 03:06:35 2016 -0400
vala: escape < and > in completion results
plugins/vala-pack/ide-vala-completion-item.vala | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/vala-pack/ide-vala-completion-item.vala b/plugins/vala-pack/ide-vala-completion-item.vala
index c48e556..00c3655 100644
--- a/plugins/vala-pack/ide-vala-completion-item.vala
+++ b/plugins/vala-pack/ide-vala-completion-item.vala
@@ -82,13 +82,17 @@ namespace Ide
return result;
}
+ private string esc_angle_brackets (string in) {
+ return in.replace ("<", "<").replace (">", ">");
+ }
+
public void build_label ()
{
GLib.StringBuilder str = new GLib.StringBuilder ();
if (this.symbol is Vala.Method) {
var method = symbol as Vala.Method;
- str.append (method.return_type.to_qualified_string (symbol.owner));
+ str.append (esc_angle_brackets (method.return_type.to_qualified_string
(symbol.owner)));
str.append_printf (" %s", method.name);
var type_params = method.get_type_parameters ();
if (type_params.size > 0) {
@@ -113,7 +117,7 @@ namespace Ide
else if (param.direction == ParameterDirection.REF)
str.append ("ref ");
- str.append_printf ("%s, ", param.variable_type.to_qualified_string
(method.owner));
+ str.append_printf ("%s, ", esc_angle_brackets
(param.variable_type.to_qualified_string (method.owner)));
}
if (parameters.size > 0) {
str.truncate (str.len - 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]