Browse Source

Merge remote-tracking branch 'upstream/master' into mansheng

newNRvisualizers
Mansheng Yang 14 years ago
parent
commit
f7a0fb5fdb
  1. 6
      ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs
  2. 4
      ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs
  3. 4
      ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs
  4. 5
      ICSharpCode.NRefactory/TypeSystem/INamespace.cs
  5. 4
      ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs
  6. 5
      ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs

6
ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs

@ -166,7 +166,11 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
{ {
// Default implementation: do nothing // Default implementation: do nothing
// Derived classes are supposed to enter the text editor's linked state. // Derived classes are supposed to enter the text editor's linked state.
return null;
// Immediately signal the task as completed:
var tcs = new TaskCompletionSource<object>();
tcs.SetResult(null);
return tcs.Task;
} }
public void Replace (AstNode node, AstNode replaceWith) public void Replace (AstNode node, AstNode replaceWith)

4
ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpAssembly.cs

@ -290,6 +290,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
get { return assembly.Compilation; } get { return assembly.Compilation; }
} }
IEnumerable<IAssembly> INamespace.ContributingAssemblies {
get { return new [] { assembly }; }
}
INamespace INamespace.GetChildNamespace(string name) INamespace INamespace.GetChildNamespace(string name)
{ {
var nameComparer = assembly.compilation.NameComparer; var nameComparer = assembly.compilation.NameComparer;

4
ICSharpCode.NRefactory.CSharp/TypeSystem/ResolvedUsingScope.cs

@ -172,6 +172,10 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
get { return EmptyList<ITypeDefinition>.Instance; } get { return EmptyList<ITypeDefinition>.Instance; }
} }
IEnumerable<IAssembly> INamespace.ContributingAssemblies {
get { return EmptyList<IAssembly>.Instance; }
}
ICompilation IResolved.Compilation { ICompilation IResolved.Compilation {
get { return parentNamespace.Compilation; } get { return parentNamespace.Compilation; }
} }

5
ICSharpCode.NRefactory/TypeSystem/INamespace.cs

@ -62,6 +62,11 @@ namespace ICSharpCode.NRefactory.TypeSystem
/// </summary> /// </summary>
IEnumerable<ITypeDefinition> Types { get; } IEnumerable<ITypeDefinition> Types { get; }
/// <summary>
/// Gets the assemblies that contribute types to this namespace (or to child namespaces).
/// </summary>
IEnumerable<IAssembly> ContributingAssemblies { get; }
/// <summary> /// <summary>
/// Gets a direct child namespace by its short name. /// Gets a direct child namespace by its short name.
/// Returns null when the namespace cannot be found. /// Returns null when the namespace cannot be found.

4
ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultUnresolvedAssembly.cs

@ -378,6 +378,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return parentNamespace; } get { return parentNamespace; }
} }
IEnumerable<IAssembly> INamespace.ContributingAssemblies {
get { return new [] { assembly }; }
}
IEnumerable<INamespace> INamespace.ChildNamespaces { IEnumerable<INamespace> INamespace.ChildNamespaces {
get { return childNamespaces; } get { return childNamespaces; }
} }

5
ICSharpCode.NRefactory/TypeSystem/Implementation/MergedNamespace.cs

@ -20,7 +20,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Text;
using ICSharpCode.NRefactory.Utils; using ICSharpCode.NRefactory.Utils;
namespace ICSharpCode.NRefactory.TypeSystem.Implementation namespace ICSharpCode.NRefactory.TypeSystem.Implementation
@ -96,6 +95,10 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
get { return compilation; } get { return compilation; }
} }
public IEnumerable<IAssembly> ContributingAssemblies {
get { return namespaces.SelectMany(ns => ns.ContributingAssemblies); }
}
public IEnumerable<INamespace> ChildNamespaces { public IEnumerable<INamespace> ChildNamespaces {
get { return GetChildNamespaces().Values; } get { return GetChildNamespaces().Values; }
} }

Loading…
Cancel
Save