diff options
author | Levi Bard <levibard@mono-cvs.ximian.com> | 2010-02-19 01:15:47 +0300 |
---|---|---|
committer | Levi Bard <levibard@mono-cvs.ximian.com> | 2010-02-19 01:15:47 +0300 |
commit | 6b15b4d0a005a08b9cc4379d34d789207242f821 (patch) | |
tree | 0c074048a06a3952033a98db9c204833ec08a9bd /extras/ValaBinding | |
parent | e5bdaf9e2ff7e317e2c9af53a9177bf528fe3eed (diff) |
* Parser/ProjectInformation.cs: Add sibling types.
svn path=/trunk/monodevelop/; revision=152029
Diffstat (limited to 'extras/ValaBinding')
-rw-r--r-- | extras/ValaBinding/ChangeLog | 4 | ||||
-rw-r--r-- | extras/ValaBinding/Parser/ProjectInformation.cs | 17 |
2 files changed, 20 insertions, 1 deletions
diff --git a/extras/ValaBinding/ChangeLog b/extras/ValaBinding/ChangeLog index f3fe7823f6..403f9ebef1 100644 --- a/extras/ValaBinding/ChangeLog +++ b/extras/ValaBinding/ChangeLog @@ -1,5 +1,9 @@ 2010-02-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> + * Parser/ProjectInformation.cs: Add sibling types. + +2010-02-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> + * Parser/ValaDocumentParser.cs: Avoid occasional parser exceptions. diff --git a/extras/ValaBinding/Parser/ProjectInformation.cs b/extras/ValaBinding/Parser/ProjectInformation.cs index 2ddc30f14b..e9be753f09 100644 --- a/extras/ValaBinding/Parser/ProjectInformation.cs +++ b/extras/ValaBinding/Parser/ProjectInformation.cs @@ -281,6 +281,21 @@ namespace MonoDevelop.ValaBinding.Parser { if (!DepsInstalled){ return; } + // Add contents of parents + ICollection<Afrodite.Symbol> containers = GetClassesForFile (filename); + AddResults (containers, results); + foreach (Afrodite.Symbol klass in containers) { + // TODO: check source references once afrodite reliably captures the entire range + for (Afrodite.Symbol parent = klass.Parent; + parent != null; + parent = parent.Parent) + { + AddResults (parent.Children.FindAll (delegate (Afrodite.Symbol sym){ + return 0 <= Array.IndexOf (containerTypes, sym.SymbolType.ToLower ()); + }), results); + } + } + using (Afrodite.Ast parseTree = engine.TryAcquireAst ()) { if (null == parseTree){ return; } @@ -292,7 +307,7 @@ namespace MonoDevelop.ValaBinding.Parser foreach (Afrodite.Symbol directive in file.UsingDirectives) { Afrodite.Symbol ns = parseTree.Lookup (directive.FullyQualifiedName, out parent); if (null != ns) { - List<Afrodite.Symbol> containers = new List<Afrodite.Symbol> (); + containers = new List<Afrodite.Symbol> (); AddResults (new Afrodite.Symbol[]{ ns }, results); foreach (Afrodite.Symbol child in ns.Children) { foreach (string containerType in containerTypes) { |