diff --git a/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs b/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs index be486dc7e3..47f0350ae1 100644 --- a/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs +++ b/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs @@ -166,7 +166,11 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring { // Default implementation: do nothing // Derived classes are supposed to enter the text editor's linked state. - return null; + + // Immediately signal the task as completed: + var tcs = new TaskCompletionSource(); + tcs.SetResult(null); + return tcs.Task; } public void Replace (AstNode node, AstNode replaceWith) diff --git a/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs b/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs index 28ee59a3f0..fe72e9b576 100644 --- a/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs +++ b/ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs @@ -290,6 +290,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem get { return assembly.Compilation; } } + IEnumerable INamespace.ContributingAssemblies { + get { return new [] { assembly }; } + } + INamespace INamespace.GetChildNamespace(string name) { var nameComparer = assembly.compilation.NameComparer; diff --git a/ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs b/ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs index f98d5a96ec..063a095192 100644 --- a/ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs +++ b/ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs @@ -172,6 +172,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem get { return EmptyList.Instance; } } + IEnumerable INamespace.ContributingAssemblies { + get { return EmptyList.Instance; } + } + ICompilation IResolved.Compilation { get { return parentNamespace.Compilation; } } diff --git a/ICSharpCode.NRefactory/TypeSystem/INamespace.cs b/ICSharpCode.NRefactory/TypeSystem/INamespace.cs index 487e4fc3e3..b3631fe060 100644 --- a/ICSharpCode.NRefactory/TypeSystem/INamespace.cs +++ b/ICSharpCode.NRefactory/TypeSystem/INamespace.cs @@ -62,6 +62,11 @@ namespace ICSharpCode.NRefactory.TypeSystem /// IEnumerable Types { get; } + /// + /// Gets the assemblies that contribute types to this namespace (or to child namespaces). + /// + IEnumerable ContributingAssemblies { get; } + /// /// Gets a direct child namespace by its short name. /// Returns null when the namespace cannot be found. diff --git a/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs b/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs index b3aba10d88..d74c1cae84 100644 --- a/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs +++ b/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs @@ -378,6 +378,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation get { return parentNamespace; } } + IEnumerable INamespace.ContributingAssemblies { + get { return new [] { assembly }; } + } + IEnumerable INamespace.ChildNamespaces { get { return childNamespaces; } } diff --git a/ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs b/ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs index 4363253f05..1ab85bcd4e 100644 --- a/ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs +++ b/ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs @@ -20,7 +20,6 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Text; using ICSharpCode.NRefactory.Utils; namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -96,6 +95,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation get { return compilation; } } + public IEnumerable ContributingAssemblies { + get { return namespaces.SelectMany(ns => ns.ContributingAssemblies); } + } + public IEnumerable ChildNamespaces { get { return GetChildNamespaces().Values; } }