diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-10-21 14:39:05 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-10-21 14:39:05 +0400 |
commit | 395945804e5b2bc2c8c6a54c0e6c9e8b8dfed909 (patch) | |
tree | 76daaeb8564d7e0563ad3a0fceb2603c53a08ef1 /main/src/addins/MonoDevelop.Refactoring | |
parent | 4b101993370fa375fe0c87c18516a9434dc41c32 (diff) |
Added unknown type resolve result / fixed add missing namespace
function.
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs index b9e2ebbec7..535dc699ae 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs @@ -89,7 +89,6 @@ namespace MonoDevelop.Refactoring public static object GetItem (ITypeResolveContext ctx, MonoDevelop.Ide.Gui.Document doc, out ResolveResult resolveResult) { resolveResult = GetResolveResult (doc); - Console.WriteLine (resolveResult); if (resolveResult is LocalResolveResult) return ((LocalResolveResult)resolveResult).Variable; if (resolveResult is MemberResolveResult) @@ -336,6 +335,14 @@ namespace MonoDevelop.Refactoring possibleNamespaces.Add (typeDefinition.Namespace); } } + } else if (resolveResult is UnknownTypeResolveResult) { + usedNamespaces = options.GetUsedNamespaces (); + var uiResult = resolveResult as UnknownTypeResolveResult; + foreach (var typeDefinition in ctx.GetTypes ()) { + if (typeDefinition.Name == uiResult.Identifier && typeDefinition.TypeParameterCount == uiResult.TypeParameterCount) { + possibleNamespaces.Add (typeDefinition.Namespace); + } + } } else if (resolveResult is UnknownMemberResolveResult) { usedNamespaces = options.GetUsedNamespaces (); var umResult = (UnknownMemberResolveResult)resolveResult; |