[gnome-builder] vala-pack: include type prefix when generating name
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] vala-pack: include type prefix when generating name
- Date: Sat, 11 Nov 2017 02:55:52 +0000 (UTC)
commit 4debd5145c79624dcd23b5dcb95d484eca108fa1
Author: Christian Hergert <chergert redhat com>
Date: Fri Nov 10 18:55:41 2017 -0800
vala-pack: include type prefix when generating name
src/plugins/vala-pack/ide-vala-code-indexer.vala | 26 +++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/vala-pack/ide-vala-code-indexer.vala
b/src/plugins/vala-pack/ide-vala-code-indexer.vala
index 69c5e65..00c4d53 100644
--- a/src/plugins/vala-pack/ide-vala-code-indexer.vala
+++ b/src/plugins/vala-pack/ide-vala-code-indexer.vala
@@ -94,9 +94,33 @@ namespace Ide
if (child.node is Vala.Symbol) {
var node = child.node as Vala.Symbol;
var loc = node.source_reference;
+ var name = child.name;
+
+ // NOTE: I don't like that we do the prefix stuff here,
+ // but we don't have a good place to do it yet.
+ switch (child.kind) {
+ case Ide.SymbolKind.FUNCTION:
+ case Ide.SymbolKind.METHOD:
+ name = "f\x1F%s".printf (name);
+ break;
+
+ case Ide.SymbolKind.VARIABLE:
+ case Ide.SymbolKind.CONSTANT:
+ name = "v\x1F%s".printf (name);
+ break;
+
+ case Ide.SymbolKind.CLASS:
+ name = "c\x1F%s".printf (name);
+ break;
+
+ default:
+ name = "x\x1F%s".printf (name);
+ break;
+ }
+
var entry = new Ide.ValaCodeIndexEntry () {
flags = child.flags,
- name = child.name,
+ name = name,
kind = child.kind,
begin_line = loc.begin.line,
begin_line_offset = loc.begin.column,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]