diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-10-05 17:28:55 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-10-05 17:28:55 +0400 |
commit | 8495e02f2cdc3e39da448188114f63527f1ea6c2 (patch) | |
tree | f078fd3f88437abf22a8b50ea8a30ea8adff2043 /main/src/addins/MonoDevelop.Refactoring | |
parent | c898cfaa91aae5405e21380eeab0c5fdcb24a0ff (diff) | |
parent | f36dd68c0c0a46e9b80b09d5e112139eed4d879e (diff) |
Merge branch 'master' into newresolver
Conflicts:
main/contrib/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/CSharpModifierToken.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IdentifierExpression.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Expressions/MemberReferenceExpression.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PointerReferenceExpression.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/DelegateDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/ExternAliasDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForeachStatement.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Statements/GotoStatement.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Statements/LabelStatement.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EnumMemberDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedVariableInitializer.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MemberDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ParameterDeclaration.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/VariableInitializer.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/TypeSystemConvertVisitor.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/ContextAction/GenerateSwitchLabels.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/ContextAction/InsertAnonymousMethodSignature.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/ContextAction/RemoveBackingStore.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Refactoring/RefactoringContext.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Resolver/CSharpAttribute.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Resolver/ConstantValues.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs
main/contrib/ICSharpCode.NRefactory.CSharp/Resolver/TypeInference.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Analysis/MinimalResolveContext.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Ast/Expressions/NamedArgumentExpression.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Ast/Expressions/TypeReferenceExpression.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Formatter/ITextEditorAdapter.cs
main/contrib/ICSharpCode.NRefactory/CSharp/OutputVisitor/IOutputFormatter.cs
main/contrib/ICSharpCode.NRefactory/CSharp/OutputVisitor/TextWriterOutputFormatter.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Parser/ParsedFile.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Parser/mcs/cs-parser.jay
main/contrib/ICSharpCode.NRefactory/CSharp/Refactoring/TypeSystemAstBuilder.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/AliasNamespaceReference.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/AmbiguousResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/ByReferenceResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/ConstantResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/Conversions.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/ErrorResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/IResolveVisitorNavigator.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/ITypeOrNamespaceReference.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/LocalResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/MapTypeIntoNewContext.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/MemberLookup.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/MemberResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/MemberTypeOrNamespaceReference.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/MethodGroupResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/NamespaceResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/NodeListResolveVisitorNavigator.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/ResolveResult.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/ResolveVisitor.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/SimpleTypeOrNamespaceReference.cs
main/contrib/ICSharpCode.NRefactory/CSharp/Resolver/TypeResolveResult.cs
main/contrib/ICSharpCode.NRefactory/Documentation/IDStringProvider.cs
main/contrib/ICSharpCode.NRefactory/Documentation/XmlDocumentationProvider.cs
main/contrib/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj
main/contrib/ICSharpCode.NRefactory/Makefile.am
main/contrib/ICSharpCode.NRefactory/PatternMatching/IPatternAstVisitor.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/ArrayType.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/ByReferenceType.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/DomRegion.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Error.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/IParsedFile.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/IProjectContent.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/ITypeResolveContext.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractType.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/CompositeTypeResolveContext.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/CompoundTypeDefinition.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultTypeDefinition.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultTypeParameter.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/ProxyTypeResolveContext.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleProjectContent.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedMember.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/Implementation/TypeStorage.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/ParameterizedType.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/PointerType.cs
main/contrib/ICSharpCode.NRefactory/TypeSystem/SharedTypes.cs
main/contrib/ICSharpCode.NRefactory/Utils/DotNet35Compat.cs
main/contrib/ICSharpCode.NRefactory/Utils/EmptyList.cs
main/contrib/ICSharpCode.NRefactory/Utils/Platform.cs
main/src/addins/CSharpBinding/CSharpBinding.csproj
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MemberCompletionData.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MethodParameterDataProvider.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.ContextAction/MDRefactoringContext.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CreateMethod/CreateMethodCodeGenerator.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs
main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs
main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs
main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs
main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs
main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs
main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs
main/src/addins/MonoDevelop.CodeMetrics/MonoDevelop.CodeMetrics.csproj
main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectInfoService.cs
main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs
main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs
main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs
main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesHandler.cs
main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/GotoDeclarationHandler.cs
main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs
main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
main/src/core/Mono.Texteditor/Mono.TextEditor/CodeSegmentPreviewWindow.cs
main/src/core/Mono.Texteditor/Mono.TextEditor/Document.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Parser/ProjectDom.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/DatabaseProjectDom.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/ProjectCodeCompletionDatabase.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom/DomCecilType.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom/DomType.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects/HelpService.cs
main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/VersionInformationTabPage.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/AmbienceService.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/CodeGenerator.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/OutputFlags.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/OutputSettings.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.TypeSystem/ParsedDocument.cs
main/tests/UnitTests/MonoDevelop.CSharpBinding/TopLevelTests.cs
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
8 files changed, 35 insertions, 20 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs index 3ecaaef96c..3e320db00a 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeGeneration/GenerateCodeWindow.cs @@ -133,7 +133,7 @@ namespace MonoDevelop.CodeGeneration GetSize (out w, out h); int myMonitor = Screen.GetMonitorAtPoint (x, y); - Gdk.Rectangle geometry = Screen.GetMonitorGeometry (myMonitor); + Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, myMonitor); if (x + w > geometry.Right) x = geometry.Right - w; diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs index d9ee1c4465..f5d8cb8aef 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs @@ -171,9 +171,9 @@ namespace MonoDevelop.Refactoring.CreateClass return result; } - protected virtual ICSharpCode.NRefactory.TypeSystem.ClassType GetNewTypeType () + protected virtual ICSharpCode.NRefactory.CSharp.ClassType GetNewTypeType () { - return ICSharpCode.NRefactory.TypeSystem.ClassType.Class; + return ICSharpCode.NRefactory.CSharp.ClassType.Class; } } diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateStructCodeGenerator.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateStructCodeGenerator.cs index f0203ed258..fd390f90f3 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateStructCodeGenerator.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.CreateClass/CreateStructCodeGenerator.cs @@ -41,9 +41,9 @@ namespace MonoDevelop.Refactoring.CreateClass return GettextCatalog.GetString ("C_reate Struct"); } - protected override ICSharpCode.NRefactory.TypeSystem.ClassType GetNewTypeType () + protected override ICSharpCode.NRefactory.CSharp.ClassType GetNewTypeType () { - return ICSharpCode.NRefactory.TypeSystem.ClassType.Struct; + return ICSharpCode.NRefactory.CSharp.ClassType.Struct; } } } diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml index aa5c4affa2..7effc1a7c5 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml @@ -7,19 +7,19 @@ url = "http://www.monodevelop.com/" description = "Provides refactoring support to MonoDevelop" category = "IDE extensions" - version = "2.7"> + version = "2.8"> <Runtime> <Import assembly = "MonoDevelop.Refactoring.dll"/> </Runtime> <Dependencies> - <Addin id="Core" version="2.7"/> - <Addin id="Ide" version="2.7"/> - <Addin id="DesignerSupport" version="2.7"/> - <Addin id="Autotools" version="2.7"/> - <Addin id="Deployment" version="2.7"/> - <Addin id="SourceEditor2" version="2.7"/> + <Addin id="Core" version="2.8"/> + <Addin id="Ide" version="2.8"/> + <Addin id="DesignerSupport" version="2.8"/> + <Addin id="Autotools" version="2.8"/> + <Addin id="Deployment" version="2.8"/> + <Addin id="SourceEditor2" version="2.8"/> </Dependencies> <!-- Extension Points --> diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj index 0fe5de9e93..f82e798a10 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj @@ -161,13 +161,15 @@ <Name>MonoDevelop.DesignerSupport</Name> <Private>False</Private> </ProjectReference> - <ProjectReference Include="..\..\..\contrib\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj"> - <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project> - <Name>ICSharpCode.NRefactory</Name> - </ProjectReference> <ProjectReference Include="..\MonoDevelop.SourceEditor2\MonoDevelop.SourceEditor.csproj"> <Project>{F8F92AA4-A376-4679-A9D4-60E7B7FBF477}</Project> <Name>MonoDevelop.SourceEditor</Name> + <Private>False</Private> + </ProjectReference> + <ProjectReference Include="..\..\..\contrib\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj"> + <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project> + <Name>ICSharpCode.NRefactory</Name> + <Private>False</Private> </ProjectReference> <ProjectReference Include="..\..\..\contrib\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj"> <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project> diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs index d1a4b4eb75..04a3c81879 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs @@ -90,9 +90,23 @@ namespace MonoDevelop.Refactoring ResolveResult resolveResult; var item = CurrentRefactoryOperationsHandler.GetItem (ctx, doc, out resolveResult); + IMember eitem = resolveResult != null ? (resolveResult.CallingMember ?? resolveResult.CallingType) : null; + string itemName = null; + if (item is IMember) + itemName = ((IMember)item).FullName; + if (item != null && eitem != null && (eitem.Equals (item) || (eitem.FullName == itemName && !(eitem is IProperty) && !(eitem is IMethod)))) { + item = eitem; + eitem = null; + } + ITypeDefinition eclass = null; if (item is ITypeDefinition) { - FindDerivedClasses ((ITypeDefinition)item); - return; + if (((ITypeDefinition)item).ClassType == ClassType.Interface) + eclass = CurrentRefactoryOperationsHandler.FindEnclosingClass (ctx, editor.Name, line, column); else + eclass = (IType)item; + if (eitem is IMethod && ((IMethod)eitem).IsConstructor && eitem.DeclaringType.Equals (item)) { + item = eitem; + eitem = null; + } } // diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs index b8958d2cf0..63bfe39469 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs @@ -159,7 +159,7 @@ namespace MonoDevelop.Refactoring if (!string.IsNullOrEmpty (replaceChange.InsertedText)) change.Offset += replaceChange.InsertedText.Length; } else if (replaceChange.Offset < change.Offset + change.RemovedChars) { - change.RemovedChars -= replaceChange.RemovedChars; + change.RemovedChars = Math.Max (0, change.RemovedChars - replaceChange.RemovedChars); change.Offset = replaceChange.Offset + (!string.IsNullOrEmpty (replaceChange.InsertedText) ? replaceChange.InsertedText.Length : 0); } } diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs index 8e7ca4c388..2b757dbbf0 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs @@ -117,7 +117,6 @@ namespace MonoDevelop.Refactoring public void Run () { - Console.WriteLine ("jump to: "+ el); IdeApp.ProjectOperations.JumpToDeclaration (el); } } |