[gnome-builder] vala: ensure .vapi are added as package type



commit 92a576b3616929828679aea7cbdb14cfc468e75e
Author: Christian Hergert <christian hergert me>
Date:   Thu Apr 21 15:40:04 2016 -0700

    vala: ensure .vapi are added as package type

 plugins/vala-pack/ide-vala-index.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plugins/vala-pack/ide-vala-index.vala b/plugins/vala-pack/ide-vala-index.vala
index b85ba3e..d663420 100644
--- a/plugins/vala-pack/ide-vala-index.vala
+++ b/plugins/vala-pack/ide-vala-index.vala
@@ -112,6 +112,8 @@ namespace Ide
 
                void add_file (GLib.File file)
                {
+                       var type = Vala.SourceFileType.SOURCE;
+
                        if (this.source_files.contains (file))
                                return;
 
@@ -119,7 +121,10 @@ namespace Ide
                        if (path == null)
                                return;
 
-                       var source_file = new Ide.ValaSourceFile (this.code_context, 
Vala.SourceFileType.SOURCE, path, null, false);
+                       if (path.has_suffix ("vapi"))
+                               type = Vala.SourceFileType.PACKAGE;
+
+                       var source_file = new Ide.ValaSourceFile (this.code_context, type, path, null, false);
                        this.code_context.add_source_file (source_file);
 
                        this.source_files [file] = source_file;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]