Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/NRefactory.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@xamarin.com>2014-03-06 12:43:56 +0400
committerMike Krüger <mkrueger@xamarin.com>2014-03-06 12:43:56 +0400
commitc5ca3ac73640dbb7d2ed8c689097c27c6b16eb11 (patch)
treea68f1c00837a77d7cc3f40e17e799a6c72885be8 /ICSharpCode.NRefactory
parent721ce129c77547b3e9da24928535c0a159faafed (diff)
Fixed add imports bug.
Diffstat (limited to 'ICSharpCode.NRefactory')
-rw-r--r--ICSharpCode.NRefactory/TypeSystem/TypeSystemExtensions.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/ICSharpCode.NRefactory/TypeSystem/TypeSystemExtensions.cs b/ICSharpCode.NRefactory/TypeSystem/TypeSystemExtensions.cs
index f62282b9..cc561f89 100644
--- a/ICSharpCode.NRefactory/TypeSystem/TypeSystemExtensions.cs
+++ b/ICSharpCode.NRefactory/TypeSystem/TypeSystemExtensions.cs
@@ -424,6 +424,15 @@ namespace ICSharpCode.NRefactory.TypeSystem
{
return compilation.Assemblies.SelectMany(a => a.GetAllTypeDefinitions());
}
+
+ /// <summary>
+ /// Gets all top level type definitions in the compilation.
+ /// This may include types from referenced assemblies that are not accessible in the main assembly.
+ /// </summary>
+ public static IEnumerable<ITypeDefinition> GetTopLevelTypeDefinitons (this ICompilation compilation)
+ {
+ return compilation.Assemblies.SelectMany(a => a.TopLevelTypeDefinitions);
+ }
/// <summary>
/// Gets the type (potentially a nested type) defined at the specified location.